Bug 1563578: Make browser_getActor_filter.js Fission-compatible.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kris Maglione 2019-08-22 20:28:36 +00:00
parent 47656aa608
commit fb8619c074
4 changed files with 33 additions and 33 deletions

View File

@ -3,21 +3,14 @@ support-files =
head.js
[browser_destroy_callbacks.js]
skip-if = fission || os == 'mac' #Bug 1572560
skip-if = os == 'mac' #Bug 1572560
[browser_event_listener.js]
skip-if = fission
[browser_getActor.js]
skip-if = fission
[browser_getActor_filter.js]
fail-if = fission
[browser_observer_notification.js]
skip-if = fission
support-files=
file_mediaPlayback.html
audio.ogg
[browser_registerWindowActor.js]
skip-if = fission
[browser_sendAsyncMessage.js]
skip-if = fission
[browser_sendQuery.js]
skip-if = fission

View File

@ -15,7 +15,7 @@ declTest("getActor with mismatch", {
);
await ContentTask.spawn(browser, {}, async function() {
let child = content.window.getWindowGlobalChild();
let child = content.getWindowGlobalChild();
ok(child, "WindowGlobalChild should have value.");
Assert.throws(
@ -36,7 +36,7 @@ declTest("getActor with matches", {
ok(parent.getActor("Test"), "JSWindowActorParent should have value.");
await ContentTask.spawn(browser, {}, async function() {
let child = content.window.getWindowGlobalChild();
let child = content.getWindowGlobalChild();
ok(child, "WindowGlobalChild should have value.");
ok(child.getActor("Test"), "JSWindowActorChild should have value.");
});
@ -55,9 +55,14 @@ declTest("getActor with iframe matches", {
content.document.body.appendChild(frame);
await ContentTaskUtils.waitForEvent(frame, "load");
is(content.window.frames.length, 1, "There should be an iframe.");
let child = frame.contentWindow.window.getWindowGlobalChild();
ok(child.getActor("Test"), "JSWindowActorChild should have value.");
is(content.frames.length, 1, "There should be an iframe.");
await content.SpecialPowers.spawn(frame, [], () => {
let child = content.getWindowGlobalChild();
Assert.ok(
child.getActor("Test"),
"JSWindowActorChild should have value."
);
});
});
},
});
@ -74,13 +79,15 @@ declTest("getActor with iframe mismatch", {
content.document.body.appendChild(frame);
await ContentTaskUtils.waitForEvent(frame, "load");
is(content.window.frames.length, 1, "There should be an iframe.");
let child = frame.contentWindow.window.getWindowGlobalChild();
Assert.throws(
() => child.getActor("Test"),
/NS_ERROR_NOT_AVAILABLE/,
"Should throw if it doesn't match."
);
is(content.frames.length, 1, "There should be an iframe.");
await content.SpecialPowers.spawn(frame, [], () => {
let child = content.getWindowGlobalChild();
Assert.throws(
() => child.getActor("Test"),
/NS_ERROR_NOT_AVAILABLE/,
"Should throw if it doesn't match."
);
});
});
},
});
@ -93,7 +100,7 @@ declTest("getActor with remoteType match", {
ok(parent.getActor("Test"), "JSWindowActorParent should have value.");
await ContentTask.spawn(browser, {}, async function() {
let child = content.window.getWindowGlobalChild();
let child = content.getWindowGlobalChild();
ok(child, "WindowGlobalChild should have value.");
ok(child.getActor("Test"), "JSWindowActorChild should have value.");
});
@ -113,7 +120,7 @@ declTest("getActor with remoteType mismatch", {
);
await ContentTask.spawn(browser, {}, async function() {
let child = content.window.getWindowGlobalChild();
let child = content.getWindowGlobalChild();
ok(child, "WindowGlobalChild should have value.");
Assert.throws(
() => child.getActor("Test"),
@ -132,8 +139,8 @@ declTest("getActor without allFrames", {
// Create and append an iframe into the window's document.
let frame = content.document.createElement("iframe");
content.document.body.appendChild(frame);
is(content.window.frames.length, 1, "There should be an iframe.");
let child = frame.contentWindow.window.getWindowGlobalChild();
is(content.frames.length, 1, "There should be an iframe.");
let child = frame.contentWindow.getWindowGlobalChild();
Assert.throws(
() => child.getActor("Test"),
/NS_ERROR_NOT_AVAILABLE/,
@ -151,8 +158,8 @@ declTest("getActor with allFrames", {
// Create and append an iframe into the window's document.
let frame = content.document.createElement("iframe");
content.document.body.appendChild(frame);
is(content.window.frames.length, 1, "There should be an iframe.");
let child = frame.contentWindow.window.getWindowGlobalChild();
is(content.frames.length, 1, "There should be an iframe.");
let child = frame.contentWindow.getWindowGlobalChild();
let actorChild = child.getActor("Test");
ok(actorChild, "JSWindowActorChild should have value.");
});

View File

@ -287,12 +287,7 @@ class SpecialPowersChild extends JSWindowActorChild {
let { SimpleTest } = this;
if (SimpleTest) {
SimpleTest.record(
passed,
name,
diag,
stack && stack.formattedStack
);
SimpleTest.record(passed, name, diag, stack);
} else {
// Well, this is unexpected.
dump(name + "\n");

View File

@ -68,7 +68,12 @@ class SpecialPowersSandbox {
`(operator ${err.operator})`;
}
this.reportCallback({ name, diag, passed: !err, stack });
this.reportCallback({
name,
diag,
passed: !err,
stack: stack && stack.formattedStack,
});
}
execute(task, args, caller) {