Bug 1586713 - Making the test 'browser/components/originattributes/test/browser/browser_postMessage.js' working in Fission. r=baku

Differential Revision: https://phabricator.services.mozilla.com/D48699

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tim Huang 2019-10-09 14:11:39 +00:00
parent 197f5544a3
commit 732a29d64f
2 changed files with 4 additions and 5 deletions

View File

@ -102,7 +102,6 @@ fail-if = fission
[browser_permissions.js]
fail-if = fission
[browser_postMessage.js]
skip-if = fission
[browser_sanitize.js]
fail-if = fission
skip-if = (os == 'win') || (os == "mac" && os_version == "10.14") || (os == "linux" && bits == 64) #Bug 1544810

View File

@ -43,7 +43,7 @@ async function runTestWithOptions(
senderURL,
true
);
ContentTask.spawn(tab.linkedBrowser, senderURL, aSenderPath => {
SpecialPowers.spawn(tab.linkedBrowser, [senderURL], aSenderPath => {
content.open(aSenderPath, "_blank");
});
@ -56,18 +56,18 @@ async function runTestWithOptions(
// 'privacy.firstparty.isolate.block_post_message' is true.
let shouldBlock = aDifferentFPD && (!aStarTargetOrigin || aBlockAcrossFPD);
await ContentTask.spawn(tab.linkedBrowser, shouldBlock, async aValue => {
await SpecialPowers.spawn(tab.linkedBrowser, [shouldBlock], async aValue => {
await new Promise(resolve => {
content.addEventListener("message", function eventHandler(aEvent) {
if (aEvent.data === "Self") {
if (aValue) {
is(
Assert.equal(
content.document.getElementById("display").innerHTML,
"",
"It should not get a message from other OA."
);
} else {
is(
Assert.equal(
content.document.getElementById("display").innerHTML,
"Message",
"It should get a message from the same OA."