зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1553804: Part 6 - Fix chrome mochitests which open chrome windows with content openers. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D45828 MANUAL PUSH: Cannot update reopened Phabricator revisions. --HG-- extra : source : 86b3d469b4ff9f22e5757f83450b956a4c769785 extra : histedit_source : 2bf945343632b15eb79cf6b2ddd3ce097ddf70de%2Caec93d9f11bc1c802b63793cd5818530b64e9b4b
This commit is contained in:
Родитель
7dbe15f5f1
Коммит
685d91c901
|
@ -119,7 +119,7 @@ function openBrowserWindowIntl() {
|
|||
}
|
||||
}
|
||||
|
||||
gBrowserContext.browserWnd = window.openDialog(
|
||||
gBrowserContext.browserWnd = window.docShell.rootTreeItem.domWindow.openDialog(
|
||||
AppConstants.BROWSER_CHROME_URL,
|
||||
"_blank",
|
||||
params,
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
this.eventSeq = [ new invokerChecker(EVENT_REORDER, gRootAcc) ];
|
||||
|
||||
this.invoke = () => (gDialog = window.openDialog(aURL));
|
||||
this.invoke = () => (gDialog = docShell.rootTreeItem.domWindow.openDialog(aURL));
|
||||
|
||||
this.finalCheck = () => {
|
||||
const accTree = {
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
];
|
||||
|
||||
|
||||
this.invoke = () => gDialog = window.openDialog(aURL);
|
||||
this.invoke = () => gDialog = window.docShell.rootTreeItem.domWindow.openDialog(aURL);
|
||||
|
||||
this.finalCheck = () => {
|
||||
const accTree = {
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
this) ];
|
||||
|
||||
this.invoke = function openWnd_invoke() {
|
||||
this.dialog = window.openDialog("about:mozilla",
|
||||
this.dialog = window.docShell.rootTreeItem.domWindow
|
||||
.openDialog("about:mozilla",
|
||||
"AboutMozilla",
|
||||
"chrome,width=600,height=600");
|
||||
};
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
var gExpected = [];
|
||||
|
||||
function ok(condition, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
|
||||
window.arguments[0].SimpleTest.ok(condition, message);
|
||||
}
|
||||
|
||||
function is(a, b, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.is(a, b, message);
|
||||
window.arguments[0].SimpleTest.is(a, b, message);
|
||||
}
|
||||
|
||||
function finish() {
|
||||
|
@ -39,7 +39,7 @@
|
|||
history.legacySHistory.PurgeHistory(history.count);
|
||||
|
||||
window.close();
|
||||
window.opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
var imports = [ "SimpleTest", "is", "isnot", "ok", "snapshotWindow",
|
||||
"compareSnapshots", "onerror" ];
|
||||
for (var name of imports) {
|
||||
window[name] = window.opener.wrappedJSObject[name];
|
||||
window[name] = window.arguments[0][name];
|
||||
}
|
||||
|
||||
function $(id) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
var imports = [ "SimpleTest", "is", "isnot", "ok"];
|
||||
for (var name of imports) {
|
||||
window[name] = window.opener.wrappedJSObject[name];
|
||||
window[name] = window.arguments[0][name];
|
||||
}
|
||||
|
||||
const text="MOZILLA";
|
||||
|
@ -38,7 +38,7 @@
|
|||
history.legacySHistory.PurgeHistory(history.count);
|
||||
|
||||
window.close();
|
||||
window.opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
function onLoad(e) {
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
var gExpected = [];
|
||||
|
||||
function ok(condition, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
|
||||
window.arguments[0].SimpleTest.ok(condition, message);
|
||||
}
|
||||
function is(a, b, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.is(a, b, message);
|
||||
window.arguments[0].SimpleTest.is(a, b, message);
|
||||
}
|
||||
function finish() {
|
||||
for (let eventType of LISTEN_EVENTS) {
|
||||
|
@ -33,7 +33,7 @@
|
|||
}
|
||||
|
||||
window.close();
|
||||
window.opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
var gExpected = [];
|
||||
|
||||
function ok(condition, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
|
||||
window.arguments[0].SimpleTest.ok(condition, message);
|
||||
}
|
||||
function is(a, b, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.is(a, b, message);
|
||||
window.arguments[0].SimpleTest.is(a, b, message);
|
||||
}
|
||||
function finish() {
|
||||
for (let eventType of LISTEN_EVENTS) {
|
||||
|
@ -34,7 +34,7 @@
|
|||
}
|
||||
|
||||
window.close();
|
||||
window.opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<script type="application/javascript"><![CDATA[
|
||||
var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ];
|
||||
for (var name of imports) {
|
||||
window[name] = window.opener.wrappedJSObject[name];
|
||||
window[name] = window.arguments[0][name];
|
||||
}
|
||||
|
||||
function $(id) {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<script type="application/javascript"><![CDATA[
|
||||
var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ];
|
||||
for (var name of imports) {
|
||||
window[name] = window.opener.wrappedJSObject[name];
|
||||
window[name] = window.arguments[0][name];
|
||||
}
|
||||
|
||||
function $(id) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
//
|
||||
async function runTests() {
|
||||
// Disable rcwn to make cache behavior deterministic.
|
||||
var {SpecialPowers} = opener;
|
||||
var {SpecialPowers} = window.arguments[0];
|
||||
await SpecialPowers.pushPrefEnv({"set":[["network.http.rcwn.enabled", false]]});
|
||||
|
||||
// Load a test page containing an image referring to the sjs that returns
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
var gExpected = [];
|
||||
|
||||
function ok(condition, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
|
||||
window.arguments[0].SimpleTest.ok(condition, message);
|
||||
}
|
||||
|
||||
function is(a, b, message) {
|
||||
window.opener.wrappedJSObject.SimpleTest.is(a, b, message);
|
||||
window.arguments[0].SimpleTest.is(a, b, message);
|
||||
}
|
||||
|
||||
function finish() {
|
||||
|
@ -39,7 +39,7 @@
|
|||
history.legacySHistory.PurgeHistory(history.count);
|
||||
|
||||
window.close();
|
||||
window.opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
function onLoad() {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
if (!window.opener && window.arguments) {
|
||||
window.opener = window.arguments[0];
|
||||
}
|
||||
/**
|
||||
* Import common SimpleTest methods so that they're usable in this window.
|
||||
*/
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<script type="application/javascript" src="docshell_helpers.js" />
|
||||
<script type="application/javascript"><![CDATA[
|
||||
function runTests() {
|
||||
let opener = window.opener;
|
||||
let SimpleTest = opener.wrappedJSObject.SimpleTest;
|
||||
let opener = window.arguments[0];
|
||||
let SimpleTest = opener.SimpleTest;
|
||||
|
||||
function getDocShellType(frame) {
|
||||
return frame.contentWindow.docShell.itemType;
|
||||
|
|
|
@ -28,8 +28,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=112564
|
|||
/** Test for Bug 112564 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug112564_window.xul", "bug112564",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug112564_window.xul", "bug112564",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=113934
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("bug113934_window.xul?content", "bug113934",
|
||||
"chrome,width=800,height=800");
|
||||
window.openDialog("bug113934_window.xul?content", "bug113934",
|
||||
"chrome,width=800,height=800,noopener", window);
|
||||
});
|
||||
|
||||
]]></script>
|
||||
|
|
|
@ -28,8 +28,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=215405
|
|||
/** Test for Bug 215405 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug215405_window.xul", "bug215405",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug215405_window.xul", "bug215405",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=293235.xul
|
|||
/** Test for Bug 293235 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug293235_window.xul", "bug293235",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug293235_window.xul", "bug293235",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=294258.xul
|
|||
/** Test for Bug 294258 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug294258_window.xul", "bug294258",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug294258_window.xul", "bug294258",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=298622.xul
|
|||
/** Test for Bug 298622 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug298622_window.xul", "bug298622",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug298622_window.xul", "bug298622",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=301397.xul
|
|||
/** Test for Bug 301397 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug301397_window.xul", "bug301397",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug301397_window.xul", "bug301397",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -30,8 +30,8 @@ SimpleTest.expectAssertions(0, 1);
|
|||
/** Test for Bug 303267 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug303267_window.xul", "bug303267",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug303267_window.xul", "bug303267",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -33,8 +33,8 @@ if (navigator.platform.startsWith("Win")) {
|
|||
/** Test for Bug 311007 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug311007_window.xul", "bug311007",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug311007_window.xul", "bug311007",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=321671.xul
|
|||
/** Test for Bug 321671 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug321671_window.xul", "bug321671",
|
||||
"chrome,width=600,height=600,scrollbars");
|
||||
window.openDialog("bug321671_window.xul", "bug321671",
|
||||
"chrome,width=600,height=600,scrollbars,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -30,8 +30,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=360511.xul
|
|||
/** Test for Bug 360511 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug360511_window.xul", "bug360511",
|
||||
"chrome,scrollbars,width=600,height=600");
|
||||
window.openDialog("bug360511_window.xul", "bug360511",
|
||||
"chrome,scrollbars,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -34,8 +34,8 @@ SpecialPowers.pushPrefEnv({
|
|||
}, runTests);
|
||||
|
||||
function runTests() {
|
||||
window.open("bug364461_window.xul", "bug364461",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug364461_window.xul", "bug364461",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=396519
|
|||
/** Test for Bug 396519 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug396519_window.xul", "bug396519",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug396519_window.xul", "bug396519",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -32,8 +32,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=396649.xul
|
|||
/** Test for Bug 396649 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug396649_window.xul", "bug396649",
|
||||
"chrome,width=600,height=600,scrollbars");
|
||||
window.openDialog("bug396649_window.xul", "bug396649",
|
||||
"chrome,width=600,height=600,scrollbars,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=449778
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("bug449778_window.xul", "bug449778",
|
||||
"chrome,width=800,height=800");
|
||||
window.openDialog("bug449778_window.xul", "bug449778",
|
||||
"chrome,width=800,height=800,noopener", window);
|
||||
});
|
||||
|
||||
]]></script>
|
||||
|
|
|
@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=449780
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("bug449780_window.xul", "bug449780",
|
||||
"chrome,width=800,height=800");
|
||||
window.openDialog("bug449780_window.xul", "bug449780",
|
||||
"chrome,width=800,height=800,noopener", window);
|
||||
});
|
||||
|
||||
]]></script>
|
||||
|
|
|
@ -21,8 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=456980
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("bug113934_window.xul?chrome", "bug456980",
|
||||
"chrome,width=800,height=800");
|
||||
window.openDialog("bug113934_window.xul?chrome", "bug456980",
|
||||
"chrome,width=800,height=800,noopener", window);
|
||||
});
|
||||
|
||||
]]></script>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=582176.xul
|
|||
/** Test for Bug 582176 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug582176_window.xul", "bug582176",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug582176_window.xul", "bug582176",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -28,6 +28,8 @@ function nextTest() {
|
|||
gen.next();
|
||||
}
|
||||
|
||||
let chromeWindow = docShell.rootTreeItem.domWindow;
|
||||
|
||||
function* doTest() {
|
||||
var notificationCount = 0;
|
||||
var observer = {
|
||||
|
@ -48,24 +50,26 @@ function* doTest() {
|
|||
is(notificationCount, 0, "initial count");
|
||||
|
||||
// create a new window
|
||||
var testWin = window.open("", "bug 608669", "chrome,width=600,height=600");
|
||||
var testWin = chromeWindow.open("", "bug 608669", "chrome,width=600,height=600");
|
||||
testWin.x = "y";
|
||||
is(notificationCount, 1, "after created window");
|
||||
|
||||
// Try loading in the window
|
||||
testWin.location = "bug608669.xul";
|
||||
window.onmessage = nextTest;
|
||||
chromeWindow.onmessage = nextTest;
|
||||
yield undefined;
|
||||
is(notificationCount, 1, "after first load");
|
||||
is(testWin.x, "y", "reused window");
|
||||
|
||||
// Try loading again in the window
|
||||
testWin.location = "bug608669.xul?x";
|
||||
window.onmessage = nextTest;
|
||||
chromeWindow.onmessage = nextTest;
|
||||
yield undefined;
|
||||
is(notificationCount, 2, "after second load");
|
||||
is("x" in testWin, false, "didn't reuse window");
|
||||
|
||||
chromeWindow.onmessage = null;
|
||||
|
||||
testWin.close();
|
||||
|
||||
os.removeObserver(observer, "chrome-document-global-created");
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=662200.xul
|
|||
/** Test for Bug 662200 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug662200_window.xul", "bug662200",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug662200_window.xul", "bug662200",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -19,8 +19,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=690056
|
|||
<![CDATA[
|
||||
/** Test for Bug 690056 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug690056_window.xul", "bug690056",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug690056_window.xul", "bug690056",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
||||
|
|
|
@ -29,8 +29,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=89419.xul
|
|||
/** Test for Bug 89419 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug89419_window.xul", "bug89419",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug89419_window.xul", "bug89419",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -28,8 +28,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=92598
|
|||
/** Test for Bug 92598 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("bug92598_window.xul", "bug92598",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("bug92598_window.xul", "bug92598",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -32,8 +32,8 @@ if (navigator.platform.startsWith("Win")) {
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
addLoadEvent(function () {
|
||||
window.open("mozFrameType_window.xul", "mozFrameType",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("mozFrameType_window.xul", "mozFrameType",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
});
|
||||
|
||||
]]>
|
||||
|
|
|
@ -61,7 +61,7 @@ var tests = [
|
|||
// force creation of a content viewer.
|
||||
let xulWinURL = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?>' +
|
||||
'<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>';
|
||||
let newWin = window.openDialog(xulWinURL, "chrome_window", "chrome");
|
||||
let newWin = docShell.rootTreeItem.domWindow.openDialog(xulWinURL, "chrome_window", "chrome");
|
||||
loadListener(newWin, function () {
|
||||
let frame = newWin.document.createXULElement("iframe");
|
||||
frame.setAttribute("type", "content");
|
||||
|
|
|
@ -18,19 +18,19 @@
|
|||
var savedMM = null;
|
||||
|
||||
function info(message) {
|
||||
return opener.wrappedJSObject.info(message);
|
||||
return window.arguments[0].info(message);
|
||||
}
|
||||
|
||||
function ok(condition, message) {
|
||||
return opener.wrappedJSObject.ok(condition, message);
|
||||
return window.arguments[0].ok(condition, message);
|
||||
}
|
||||
|
||||
function is(v1, v2, message) {
|
||||
return opener.wrappedJSObject.is(v1, v2, message);
|
||||
return window.arguments[0].is(v1, v2, message);
|
||||
}
|
||||
|
||||
function todo_is(v1, v2, message) {
|
||||
return opener.wrappedJSObject.todo_is(v1, v2, message);
|
||||
return window.arguments[0].todo_is(v1, v2, message);
|
||||
}
|
||||
|
||||
// Make sure that an error in this file actually causes the test to fail.
|
||||
|
@ -411,7 +411,7 @@
|
|||
}
|
||||
failed = true;
|
||||
}
|
||||
opener.wrappedJSObject.SpecialPowers.clearUserPref(PREF_UNSAFE_FORBIDDEN);
|
||||
window.arguments[0].SpecialPowers.clearUserPref(PREF_UNSAFE_FORBIDDEN);
|
||||
ok(failed, "CPOW should fail when unsafe");
|
||||
msg.target.messageManager.sendAsyncMessage("cpows:unsafe_done");
|
||||
}
|
||||
|
@ -427,7 +427,7 @@
|
|||
}
|
||||
ok(false, "cpow failed");
|
||||
}
|
||||
opener.wrappedJSObject.SpecialPowers.clearUserPref(PREF_UNSAFE_FORBIDDEN);
|
||||
window.arguments[0].SpecialPowers.clearUserPref(PREF_UNSAFE_FORBIDDEN);
|
||||
msg.target.messageManager.sendAsyncMessage("cpows:safe_done");
|
||||
}
|
||||
|
||||
|
@ -512,7 +512,7 @@
|
|||
|
||||
function finish() {
|
||||
ok(gReceivedErrorProbe, "Should have reported error probe");
|
||||
opener.setTimeout(function() { this.done(); }, 0);
|
||||
window.arguments[0].setTimeout(function() { this.done(); }, 0);
|
||||
window.close();
|
||||
}
|
||||
]]></script>
|
||||
|
|
|
@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1139964
|
|||
var ppm = Cc["@mozilla.org/parentprocessmessagemanager;1"].getService();
|
||||
|
||||
function ok(cond, msg) {
|
||||
opener.wrappedJSObject.ok(cond, msg);
|
||||
window.arguments[0].ok(cond, msg);
|
||||
}
|
||||
|
||||
var msgName = "TEST:Global_has_Promise";
|
||||
|
@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1139964
|
|||
ok(m.data.hasTextEncoder, "BrowserChildGlobal should have TextEncoder object in the global scope!");
|
||||
ok(m.data.hasWindow, "BrowserChildGlobal should have Window object in the global scope!");
|
||||
|
||||
opener.setTimeout(function() { this.done(); }, 0);
|
||||
window.arguments[0].setTimeout(function() { this.done(); }, 0);
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,11 +12,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1209621
|
|||
<!-- test code goes here -->
|
||||
<script type="application/javascript"><![CDATA[
|
||||
function ok(cond, msg) {
|
||||
opener.wrappedJSObject.ok(cond, msg);
|
||||
window.arguments[0].ok(cond, msg);
|
||||
}
|
||||
|
||||
function is(actual, expected, msg) {
|
||||
opener.wrappedJSObject.is(actual, expected, msg);
|
||||
window.arguments[0].is(actual, expected, msg);
|
||||
}
|
||||
|
||||
function run() {
|
||||
|
@ -64,7 +64,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1209621
|
|||
is(treeOwner.primaryContentShell, null,
|
||||
"There shouldn't be primaryContentShell because no browser has primary=true.");
|
||||
|
||||
opener.setTimeout(function() { this.done(); }, 0);
|
||||
window.arguments[0].setTimeout(function() { this.done(); }, 0);
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
|
|||
var cpm = Cc["@mozilla.org/childprocessmessagemanager;1"].getService();
|
||||
|
||||
function ok(cond, msg) {
|
||||
opener.wrappedJSObject.ok(cond, msg);
|
||||
window.arguments[0].ok(cond, msg);
|
||||
}
|
||||
|
||||
function is(actual, expected, msg) {
|
||||
opener.wrappedJSObject.is(actual, expected, msg);
|
||||
window.arguments[0].is(actual, expected, msg);
|
||||
}
|
||||
|
||||
var asyncPPML = false;
|
||||
|
@ -119,7 +119,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
|
|||
}
|
||||
|
||||
function finish() {
|
||||
opener.setTimeout(function() { this.done(); }, 0);
|
||||
window.arguments[0].setTimeout(function() { this.done(); }, 0);
|
||||
var i = document.getElementById("ifr");
|
||||
i.remove(); // This is a crash test!
|
||||
window.close();
|
||||
|
|
|
@ -38,7 +38,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
|
|||
function recvCmp(m) {
|
||||
var i = m.json.i, cmp = m.json.cmp;
|
||||
var pair = toCompare[i];
|
||||
opener.wrappedJSObject.is(pair[0].localeCompare(pair[1]), cmp, "localeCompare returned same result in frame script");
|
||||
window.arguments[0].is(pair[0].localeCompare(pair[1]), cmp, "localeCompare returned same result in frame script");
|
||||
|
||||
if (toCompare.length == ++nCmps) {
|
||||
messageManager.removeMessageListener("cmp", recvCmp);
|
||||
|
@ -53,7 +53,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
|
|||
}
|
||||
|
||||
function finish() {
|
||||
opener.setTimeout(function() { this.done(); }, 0);
|
||||
window.arguments[0].setTimeout(function() { this.done(); }, 0);
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=816340
|
|||
<script type="application/javascript"><![CDATA[
|
||||
|
||||
function ok(val, msg) {
|
||||
opener.wrappedJSObject.ok(val, msg);
|
||||
window.arguments[0].ok(val, msg);
|
||||
}
|
||||
|
||||
var elems =
|
||||
|
@ -60,7 +60,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=816340
|
|||
testElement(elems[i], true, false);
|
||||
}
|
||||
ok(true, "done");
|
||||
opener.setTimeout(function() { this.done(); }, 0);
|
||||
window.arguments[0].setTimeout(function() { this.done(); }, 0);
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
|
||||
|
||||
function is(val, exp, msg) {
|
||||
opener.wrappedJSObject.is(val, exp, msg);
|
||||
window.arguments[0].is(val, exp, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,10 +37,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
|
||||
messageManager.addMessageListener("test", function onMessage(msg) {
|
||||
var next = order.shift();
|
||||
opener.wrappedJSObject.is(msg.data, next, "received test:" + next);
|
||||
window.arguments[0].is(msg.data, next, "received test:" + next);
|
||||
|
||||
if (order.length == 0) {
|
||||
opener.setTimeout(function() { this.next(); });
|
||||
window.arguments[0].setTimeout(function() { this.next(); });
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
|
||||
|
||||
function is(val, exp, msg) {
|
||||
opener.wrappedJSObject.is(val, exp, msg);
|
||||
window.arguments[0].is(val, exp, msg);
|
||||
}
|
||||
|
||||
function promiseMessage(type, mm) {
|
||||
|
@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
browser.messageManager.loadFrameScript(FRAME_SCRIPT, true);
|
||||
|
||||
Promise.all([global, window, group]).then(function () {
|
||||
opener.setTimeout(function() { this.next(); });
|
||||
self.arguments[0].setTimeout(function() { this.next(); });
|
||||
self.close();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
|
||||
|
||||
function is(val, exp, msg) {
|
||||
opener.wrappedJSObject.is(val, exp, msg);
|
||||
window.arguments[0].is(val, exp, msg);
|
||||
}
|
||||
|
||||
function promiseMessage(type, mm) {
|
||||
|
@ -55,7 +55,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
globalMM.broadcastAsyncMessage("test", "global");
|
||||
|
||||
Promise.all([promise1, promise2]).then(function () {
|
||||
opener.setTimeout(function() { this.next(); });
|
||||
window.arguments[0].setTimeout(function() { this.next(); });
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
|
||||
|
||||
function is(val, exp, msg) {
|
||||
opener.wrappedJSObject.is(val, exp, msg);
|
||||
window.arguments[0].is(val, exp, msg);
|
||||
}
|
||||
|
||||
function promiseMessage(type, mm) {
|
||||
|
@ -50,7 +50,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
messageManager.broadcastAsyncMessage("test");
|
||||
|
||||
Promise.all([promise1, promise2]).then(function () {
|
||||
opener.setTimeout(function() { this.next(); });
|
||||
window.arguments[0].setTimeout(function() { this.next(); });
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService();
|
||||
|
||||
function is(val, exp, msg) {
|
||||
opener.wrappedJSObject.is(val, exp, msg);
|
||||
window.arguments[0].is(val, exp, msg);
|
||||
}
|
||||
|
||||
function promiseTwoMessages(type, mm) {
|
||||
|
@ -58,7 +58,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
messageManager.broadcastAsyncMessage("test");
|
||||
|
||||
Promise.all([promise1, promise2]).then(function () {
|
||||
opener.setTimeout(function() { this.next(); });
|
||||
window.arguments[0].setTimeout(function() { this.next(); });
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1139964
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("file_bug1139964.xul", "", "chrome");
|
||||
window.openDialog("file_bug1139964.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1209621
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("file_bug1209621.xul", "", "chrome");
|
||||
window.openDialog("file_bug1209621.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
|
||||
]]>
|
||||
|
|
|
@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=549682
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("file_bug549682.xul", "", "chrome");
|
||||
window.openDialog("file_bug549682.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616841
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("file_bug616841.xul", "", "chrome");
|
||||
window.openDialog("file_bug616841.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -23,8 +23,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=814638
|
|||
|
||||
function startTest() {
|
||||
let hostURL = "chrome://mochitests/content/chrome/dom/base/test/chrome/host_bug814638.xul";
|
||||
let host1 = window.open(hostURL, "_blank", "chrome");
|
||||
let host2 = window.open(hostURL, "_blank", "chrome");
|
||||
let host1 = docShell.rootTreeItem.domWindow.open(hostURL, "_blank", "chrome");
|
||||
let host2 = docShell.rootTreeItem.domWindow.open(hostURL, "_blank", "chrome");
|
||||
|
||||
let isHost1Loaded = isHost2Loaded = false
|
||||
host1.onload = function() {
|
||||
|
|
|
@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=816340
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("file_bug816340.xul", "", "chrome");
|
||||
window.openDialog("file_bug816340.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -31,7 +31,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=990812
|
|||
if (tests.length > 0) {
|
||||
var file = tests.shift();
|
||||
info("-- running " + file);
|
||||
window.open(file, "", "chrome");
|
||||
window.openDialog(file, "_blank", "chrome,noopener", window);
|
||||
} else {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ windows.
|
|||
* nonRemote<num>: a reference to the non-remote browser in the window
|
||||
*/
|
||||
async function prepareWindow(num, page) {
|
||||
let win = window.open(BROWSER_DOC, "bug1474662-" + num, "chrome,width=200,height=200");
|
||||
let win = docShell.rootTreeItem.domWindow.open(BROWSER_DOC, "bug1474662-" + num, "chrome,width=200,height=200");
|
||||
await BrowserTestUtils.waitForEvent(win, "load");
|
||||
let remote = win.document.getElementById("remote");
|
||||
let nonRemote = win.document.getElementById("non-remote");
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("cpows_parent.xul", "", "chrome");
|
||||
window.openDialog("cpows_parent.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -37,7 +37,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1411707
|
|||
// expect both events to fire with the docs in the correct state.
|
||||
async function testEvents() {
|
||||
info(`Waiting for events after loading ${OUTER_URL}`);
|
||||
let win = window.openDialog(OUTER_URL, null, "chrome,dialog=no,all");
|
||||
let win = docShell.rootTreeItem.domWindow.openDialog(OUTER_URL, "_blank", "chrome,dialog=no,all");
|
||||
await waitForEvent(OUTER_URL);
|
||||
await waitForEvent(INNER_URL);
|
||||
win.close();
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<![CDATA[
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("window_nsITextInputProcessor.xul", "_blank",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("window_nsITextInputProcessor.xul", "_blank",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
|
|
@ -19,7 +19,7 @@ Test swapFrameLoaders with different frame types and remoteness
|
|||
<script type="application/javascript"><![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
window.open("window_swapFrameLoaders.xul", "bug1242644",
|
||||
"chrome,width=600,height=600");
|
||||
window.openDialog("window_swapFrameLoaders.xul", "bug1242644",
|
||||
"chrome,width=600,height=600,noopener", window);
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -22,8 +22,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=481777
|
|||
/** Test for Bug 481777 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
window.open("title_window.xul", "bug481777",
|
||||
"chrome,width=100,height=100");
|
||||
window.openDialog("title_window.xul", "bug481777",
|
||||
"chrome,width=100,height=100,noopener", window);
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<![CDATA[
|
||||
var imports = [ "SimpleTest", "is", "isnot", "ok" ];
|
||||
for (var name of imports) {
|
||||
window[name] = window.opener.wrappedJSObject[name];
|
||||
window[name] = window.arguments[0][name];
|
||||
}
|
||||
|
||||
function testStatics() {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
|
||||
var SimpleTest = window.arguments[0].SimpleTest;
|
||||
|
||||
SimpleTest.waitForFocus(runTests, window);
|
||||
|
||||
|
@ -78,7 +78,7 @@ var iframe = document.getElementById("iframe");
|
|||
var childWindow = iframe.contentWindow;
|
||||
var textareaInFrame;
|
||||
var input = document.getElementById("input");
|
||||
var otherWindow = window.opener;
|
||||
var otherWindow = window.arguments[0];
|
||||
var otherDocument = otherWindow.document;
|
||||
var inputInChildWindow = otherDocument.getElementById("input");
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ Test swapFrameLoaders with different frame types and remoteness
|
|||
|
||||
<script type="application/javascript"><![CDATA[
|
||||
["SimpleTest", "SpecialPowers", "info", "is", "ok", "add_task"].forEach(key => {
|
||||
window[key] = window.opener[key];
|
||||
window[key] = window.arguments[0][key];
|
||||
})
|
||||
|
||||
const NS = {
|
||||
|
|
|
@ -12,8 +12,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1016960
|
|||
|
||||
/** Test for Bug 1016960 **/
|
||||
|
||||
var chromeWindow = window.open("chrome://mochitests/content/chrome/dom/base/test/file_empty.html", "1016960", "chrome");
|
||||
ok(chromeWindow.isChromeWindow, "A chrome window should return true for |instanceof ChromeWindow|.");
|
||||
var chromeWindow = docShell.rootTreeItem.domWindow.open("chrome://mochitests/content/chrome/dom/base/test/file_empty.html", "1016960", "chrome");
|
||||
ok(chromeWindow.isChromeWindow, "A chrome window should return true for .isChromeWindow.");
|
||||
chromeWindow.close();
|
||||
|
||||
</script>
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
|
||||
// Need to open as a toplevel chrome window so that
|
||||
// DRAWWINDOW_USE_WIDGET_LAYERS is honored.
|
||||
sourceWindow = window.open("file_drawWindow_source.html", "",
|
||||
`chrome,width=${WINDOW_INNER_WIDTH},height=${WINDOW_INNER_HEIGHT}`);
|
||||
sourceWindow = docShell.rootTreeItem.domWindow.open("file_drawWindow_source.html", "",
|
||||
`chrome,width=${WINDOW_INNER_WIDTH},height=${WINDOW_INNER_HEIGHT}`);
|
||||
SimpleTest.waitForFocus(runTests, sourceWindow);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1412775
|
|||
var win;
|
||||
function init() {
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
win = window.open("window_bug1412775.xul", "_new", "chrome");
|
||||
win = docShell.rootTreeItem.domWindow.open("window_bug1412775.xul", "_new", "chrome");
|
||||
win.onload = function() {
|
||||
var b = win.document.getElementById("browser");
|
||||
var d = b.contentWindow.document;
|
||||
|
|
|
@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=617528
|
|||
var browser;
|
||||
|
||||
function start() {
|
||||
_window = window.open("window_bug617528.xul", "_new", "chrome");
|
||||
_window = docShell.rootTreeItem.domWindow.open("window_bug617528.xul", "_new", "chrome");
|
||||
_window.addEventListener("load", onLoad, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
|
||||
const ok = window.opener.wrappedJSObject.ok;
|
||||
const is = window.opener.wrappedJSObject.is;
|
||||
const done = window.opener.wrappedJSObject.done;
|
||||
const SimpleTest = window.opener.wrappedJSObject.SimpleTest;
|
||||
const ok = window.arguments[0].ok;
|
||||
const is = window.arguments[0].is;
|
||||
const done = window.arguments[0].done;
|
||||
const SimpleTest = window.arguments[0].SimpleTest;
|
||||
|
||||
// Allow the browser to get connected before using the messageManager to cause
|
||||
// a crash:
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.expectChildProcessCrash();
|
||||
|
||||
var w = window.open('process_error.xul', '_blank', 'chrome,resizable=yes,width=400,height=600');
|
||||
var w = docShell.rootTreeItem.domWindow.openDialog('process_error.xul', '_blank', 'chrome,resizable=yes,width=400,height=600', window);
|
||||
|
||||
function done()
|
||||
{
|
||||
|
|
|
@ -2,23 +2,23 @@ let port;
|
|||
let mm;
|
||||
|
||||
function info(message) {
|
||||
return opener.wrappedJSObject.info(message);
|
||||
return window.arguments[0].info(message);
|
||||
}
|
||||
|
||||
function ok(condition, message) {
|
||||
return opener.wrappedJSObject.ok(condition, message);
|
||||
return window.arguments[0].ok(condition, message);
|
||||
}
|
||||
|
||||
function is(v1, v2, message) {
|
||||
return opener.wrappedJSObject.is(v1, v2, message);
|
||||
return window.arguments[0].is(v1, v2, message);
|
||||
}
|
||||
|
||||
function todo_is(v1, v2, message) {
|
||||
return opener.wrappedJSObject.todo_is(v1, v2, message);
|
||||
return window.arguments[0].todo_is(v1, v2, message);
|
||||
}
|
||||
|
||||
function cleanUp() {
|
||||
opener.setTimeout(function() {
|
||||
window.arguments[0].setTimeout(function() {
|
||||
this.done();
|
||||
}, 0);
|
||||
window.close();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("mm_messageChannelParent.xul", "", "chrome");
|
||||
window.openDialog("mm_messageChannelParent.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
}
|
||||
|
||||
addLoadEvent(function() {
|
||||
window.open("mm_messageChannelParentNotRemote.xul", "", "chrome");
|
||||
window.openDialog("mm_messageChannelParentNotRemote.xul", "", "chrome,noopener", window);
|
||||
});
|
||||
]]></script>
|
||||
</window>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
|
||||
|
||||
var w = window.open('xulbrowser_plugin_visibility.xul', '_blank', 'chrome,resizable=yes,width=400,height=600');
|
||||
var w = docShell.rootTreeItem.domWindow.openDialog('xulbrowser_plugin_visibility.xul', '_blank', 'chrome,resizable=yes,width=400,height=600', window);
|
||||
|
||||
function done()
|
||||
{
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
<script type="application/javascript" src="plugin-utils.js"/>
|
||||
<script type="application/javascript"><![CDATA[
|
||||
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
const ok = window.opener.wrappedJSObject.ok;
|
||||
const is = window.opener.wrappedJSObject.is;
|
||||
const done = window.opener.wrappedJSObject.done;
|
||||
const SimpleTest = window.opener.wrappedJSObject.SimpleTest;
|
||||
const ok = window.arguments[0].ok;
|
||||
const is = window.arguments[0].is;
|
||||
const done = window.arguments[0].done;
|
||||
const SimpleTest = window.arguments[0].SimpleTest;
|
||||
|
||||
const nsIWebProgress = Ci.nsIWebProgress;
|
||||
const nsIWebProgressListener = Ci.nsIWebProgressListener;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
src="chrome://mochikit/content/chrome-harness.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
|
||||
var SimpleTest = window.arguments[0].SimpleTest;
|
||||
|
||||
document.addEventListener("DOMWindowCreated", function(e) {
|
||||
var otherWindow = e.target.defaultView.wrappedJSObject;
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
<script type="application/javascript"><![CDATA[
|
||||
|
||||
function ok(condition, msg) {
|
||||
window.opener.wrappedJSObject.ok(condition, msg);
|
||||
window.arguments[0].ok(condition, msg);
|
||||
}
|
||||
|
||||
function is(a, b, msg) {
|
||||
window.opener.wrappedJSObject.is(a, b, msg);
|
||||
window.arguments[0].is(a, b, msg);
|
||||
}
|
||||
|
||||
var gBrowser = null;
|
||||
|
@ -88,7 +88,7 @@ function earlyExit(event) {
|
|||
function lastExit(event) {
|
||||
is(event.target, gOuterDoc, "MozDOMFullscreen:Exited should be targeted at the last exited doc");
|
||||
ok(gOuterDoc.fullscreenElement == null, "Fullscreen should have been fully exited");
|
||||
window.opener.wrappedJSObject.done();
|
||||
window.arguments[0].done();
|
||||
}
|
||||
|
||||
function start() {
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
/** Test for Bug 799299 **/
|
||||
var SimpleTest = opener.wrappedJSObject.SimpleTest;
|
||||
var ok = opener.wrappedJSObject.ok;
|
||||
var SimpleTest = window.arguments[0].SimpleTest;
|
||||
var ok = window.arguments[0].ok;
|
||||
|
||||
// Note: We can't use frames[0] here because the type="content" attribute
|
||||
// isolates it into a separate browsing context hierarchy.
|
||||
|
@ -26,7 +26,7 @@
|
|||
"Should be instance of HTMLLabelElement");
|
||||
|
||||
window.close();
|
||||
opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
||||
|
|
|
@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1224790
|
|||
|
||||
function nonModalClosed() {
|
||||
window.close();
|
||||
opener.wrappedJSObject.modalClosed();
|
||||
window.arguments[0].modalClosed();
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
|
|
|
@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1224790
|
|||
|
||||
function nonModalOpened() {
|
||||
window.close();
|
||||
nonModal.wrappedJSObject.modalClosed(opener);
|
||||
nonModal.modalClosed(window.arguments[0]);
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
|
|
|
@ -30,29 +30,29 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=799299
|
|||
var b1 = document.getElementById("b1");
|
||||
var b2 = document.getElementById("b2");
|
||||
b1.contentWindow.focus();
|
||||
opener.wrappedJSObject.is(document.activeElement, b1,
|
||||
"Focused first iframe");
|
||||
window.arguments[0].is(document.activeElement, b1,
|
||||
"Focused first iframe");
|
||||
|
||||
var didCallDummy = false;
|
||||
b2.contentWindow.addEventListener("mousedown", function(e) { didCallDummy = true; });
|
||||
sendClick(b2.contentWindow);
|
||||
opener.wrappedJSObject.ok(didCallDummy, "dummy mousedown handler should fire");
|
||||
opener.wrappedJSObject.is(document.activeElement, b2,
|
||||
"Focus shifted to second iframe");
|
||||
window.arguments[0].ok(didCallDummy, "dummy mousedown handler should fire");
|
||||
window.arguments[0].is(document.activeElement, b2,
|
||||
"Focus shifted to second iframe");
|
||||
|
||||
b1.contentWindow.focus();
|
||||
opener.wrappedJSObject.is(document.activeElement, b1,
|
||||
"Re-focused first iframe for the first time");
|
||||
window.arguments[0].is(document.activeElement, b1,
|
||||
"Re-focused first iframe for the first time");
|
||||
|
||||
var didCallListener = false;
|
||||
b2.contentWindow.addEventListener("mousedown", function(e) { didCallListener = true; e.preventDefault(); });
|
||||
sendClick(b2.contentWindow);
|
||||
opener.wrappedJSObject.ok(didCallListener, "mousedown handler should fire");
|
||||
opener.wrappedJSObject.is(document.activeElement, b2,
|
||||
"focus should move to the second iframe");
|
||||
window.arguments[0].ok(didCallListener, "mousedown handler should fire");
|
||||
window.arguments[0].is(document.activeElement, b2,
|
||||
"focus should move to the second iframe");
|
||||
|
||||
window.close();
|
||||
opener.wrappedJSObject.SimpleTest.finish();
|
||||
window.arguments[0].SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
|
|
|
@ -30,41 +30,41 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=800817
|
|||
var b1 = document.getElementById("b1");
|
||||
var b2 = document.getElementById("b2");
|
||||
|
||||
var testMozBrowser = opener.wrappedJSObject.testMozBrowser;
|
||||
var testMozBrowser = window.arguments[0].testMozBrowser;
|
||||
if (testMozBrowser) {
|
||||
b1.setAttribute("mozbrowser", "true");
|
||||
b2.setAttribute("mozbrowser", "true");
|
||||
}
|
||||
|
||||
if (testMozBrowser)
|
||||
opener.wrappedJSObject.info("Testing with mozbrowser=true");
|
||||
window.arguments[0].info("Testing with mozbrowser=true");
|
||||
else
|
||||
opener.wrappedJSObject.info("Testing without mozbrowser");
|
||||
window.arguments[0].info("Testing without mozbrowser");
|
||||
|
||||
b1.contentWindow.focus();
|
||||
opener.wrappedJSObject.is(document.activeElement, b1,
|
||||
"Focused first iframe");
|
||||
window.arguments[0].is(document.activeElement, b1,
|
||||
"Focused first iframe");
|
||||
|
||||
var didCallDummy = false;
|
||||
b2.contentWindow.addEventListener("mousedown", function(e) { didCallDummy = true; });
|
||||
sendClick(b2.contentWindow);
|
||||
opener.wrappedJSObject.ok(didCallDummy, "dummy mousedown handler should fire");
|
||||
opener.wrappedJSObject.is(document.activeElement, b2,
|
||||
"Focus shifted to second iframe");
|
||||
window.arguments[0].ok(didCallDummy, "dummy mousedown handler should fire");
|
||||
window.arguments[0].is(document.activeElement, b2,
|
||||
"Focus shifted to second iframe");
|
||||
|
||||
b1.contentWindow.focus();
|
||||
opener.wrappedJSObject.is(document.activeElement, b1,
|
||||
"Re-focused first iframe for the first time");
|
||||
window.arguments[0].is(document.activeElement, b1,
|
||||
"Re-focused first iframe for the first time");
|
||||
|
||||
var didCallListener = false;
|
||||
b2.contentWindow.addEventListener("mousedown", function(e) { didCallListener = true; e.preventDefault(); });
|
||||
sendClick(b2.contentWindow);
|
||||
opener.wrappedJSObject.ok(didCallListener, "mousedown handler should fire");
|
||||
opener.wrappedJSObject.is(document.activeElement, b1,
|
||||
"Did not move focus to the second iframe");
|
||||
window.arguments[0].ok(didCallListener, "mousedown handler should fire");
|
||||
window.arguments[0].is(document.activeElement, b1,
|
||||
"Did not move focus to the second iframe");
|
||||
|
||||
window.close();
|
||||
opener.wrappedJSObject.finishedTests();
|
||||
window.arguments[0].finishedTests();
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
|
|
|
@ -34,27 +34,27 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=830858
|
|||
b.addEventListener("foo", function() { ++iframeListenerCalled; }, true);
|
||||
|
||||
doc.dispatchEvent(new Event("foo"));
|
||||
opener.wrappedJSObject.is(docListenerCalled, 1, "Normal dispatch to Document");
|
||||
opener.wrappedJSObject.is(winListenerCalled, 1, "Normal dispatch to Document");
|
||||
opener.wrappedJSObject.is(iframeListenerCalled, 1, "Normal dispatch to Document");
|
||||
window.arguments[0].is(docListenerCalled, 1, "Normal dispatch to Document");
|
||||
window.arguments[0].is(winListenerCalled, 1, "Normal dispatch to Document");
|
||||
window.arguments[0].is(iframeListenerCalled, 1, "Normal dispatch to Document");
|
||||
|
||||
win.dispatchEvent(new Event("foo"));
|
||||
opener.wrappedJSObject.is(docListenerCalled, 1, "Normal dispatch to Window");
|
||||
opener.wrappedJSObject.is(winListenerCalled, 2, "Normal dispatch to Window");
|
||||
opener.wrappedJSObject.is(iframeListenerCalled, 2, "Normal dispatch to Window");
|
||||
window.arguments[0].is(docListenerCalled, 1, "Normal dispatch to Window");
|
||||
window.arguments[0].is(winListenerCalled, 2, "Normal dispatch to Window");
|
||||
window.arguments[0].is(iframeListenerCalled, 2, "Normal dispatch to Window");
|
||||
|
||||
wu.dispatchEventToChromeOnly(doc, new Event("foo"));
|
||||
opener.wrappedJSObject.is(docListenerCalled, 1, "Chrome-only dispatch to Document");
|
||||
opener.wrappedJSObject.is(winListenerCalled, 2, "Chrome-only dispatch to Document");
|
||||
opener.wrappedJSObject.is(iframeListenerCalled, 3, "Chrome-only dispatch to Document");
|
||||
window.arguments[0].is(docListenerCalled, 1, "Chrome-only dispatch to Document");
|
||||
window.arguments[0].is(winListenerCalled, 2, "Chrome-only dispatch to Document");
|
||||
window.arguments[0].is(iframeListenerCalled, 3, "Chrome-only dispatch to Document");
|
||||
|
||||
wu.dispatchEventToChromeOnly(win, new Event("foo"));
|
||||
opener.wrappedJSObject.is(docListenerCalled, 1, "Chrome-only dispatch to Window");
|
||||
opener.wrappedJSObject.is(winListenerCalled, 2, "Chrome-only dispatch to Window");
|
||||
opener.wrappedJSObject.is(iframeListenerCalled, 4, "Chrome-only dispatch to Window");
|
||||
window.arguments[0].is(docListenerCalled, 1, "Chrome-only dispatch to Window");
|
||||
window.arguments[0].is(winListenerCalled, 2, "Chrome-only dispatch to Window");
|
||||
window.arguments[0].is(iframeListenerCalled, 4, "Chrome-only dispatch to Window");
|
||||
|
||||
window.close();
|
||||
opener.wrappedJSObject.finishedTests();
|
||||
window.arguments[0].finishedTests();
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(runTests);
|
||||
|
|
|
@ -1 +1 @@
|
|||
<body onload='window.opener.doChecks(this)'><input id='i' value='Sample Text'></body>
|
||||
<body onload='window.arguments[0].doChecks(this)'><input id='i' value='Sample Text'></body>
|
||||
|
|
|
@ -13,7 +13,7 @@ window.addEventListener("fullscreen", onFullScreen, true);
|
|||
|
||||
function onFullScreen(event)
|
||||
{
|
||||
window.opener.wrappedJSObject.done(window.fullScreen);
|
||||
window.arguments[0].done(window.fullScreen);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -46,7 +46,7 @@ let tests = [
|
|||
},
|
||||
|
||||
function test8() {
|
||||
window.opener.wrappedJSObject.done();
|
||||
window.arguments[0].done();
|
||||
}
|
||||
];
|
||||
|
||||
|
@ -77,7 +77,7 @@ function checkAndContinue(sizemode) {
|
|||
}, 0);
|
||||
}
|
||||
|
||||
let is = window.opener.wrappedJSObject.is;
|
||||
let is = window.arguments[0].is;
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var root = getRootDirectory(window.location.href);
|
||||
window.open(root + "DOMWindowCreated_chrome.xul", "_blank", "chrome,width=600,height=550");
|
||||
window.openDialog(root + "DOMWindowCreated_chrome.xul", "_blank", "chrome,width=600,height=550,noopener", window);
|
||||
</script>
|
||||
|
||||
</window>
|
||||
|
|
|
@ -22,7 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=824917
|
|||
/** Test for Bug 824917 **/
|
||||
|
||||
function runTests() {
|
||||
window.open("file_DOM_element_instanceof.xul", "_blank", "chrome,width=600,height=550");
|
||||
window.openDialog("file_DOM_element_instanceof.xul", "_blank", "chrome,width=600,height=550,noopener", window);
|
||||
}
|
||||
|
||||
addLoadEvent(runTests);
|
||||
|
|
|
@ -38,7 +38,8 @@ SpecialPowers.pushPrefEnv({"set": [
|
|||
]}, setup);
|
||||
|
||||
function setup() {
|
||||
newwindow = window.open("MozDomFullscreen_chrome.xul", "_blank","chrome,resizable=yes,width=400,height=400");
|
||||
newwindow = docShell.rootTreeItem.domWindow.openDialog(
|
||||
"MozDomFullscreen_chrome.xul", "_blank","chrome,dialog=no,resizable=yes,width=400,height=400", window);
|
||||
}
|
||||
|
||||
function done()
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
newwindow = window.open("window_activation.xul", "_blank","chrome,width=300,height=200");
|
||||
newwindow = docShell.rootTreeItem.domWindow.openDialog("window_activation.xul", "_blank","chrome,width=300,height=200", window);
|
||||
|
||||
function complete()
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1224790
|
|||
*/
|
||||
|
||||
function startTest() {
|
||||
window.openDialog('file_bug1224790-1_modal.xul', '', 'modal');
|
||||
window.openDialog('file_bug1224790-1_modal.xul', '', 'modal,noopener', window);
|
||||
}
|
||||
|
||||
function modalClosed() {
|
||||
|
|
|
@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1224790
|
|||
*/
|
||||
|
||||
function startTest() {
|
||||
window.openDialog('file_bug1224790-2_modal.xul', '', 'modal');
|
||||
window.openDialog('file_bug1224790-2_modal.xul', '', 'modal,noopener', window);
|
||||
}
|
||||
|
||||
function nonModalClosed() {
|
||||
|
|
|
@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=799299
|
|||
/** Test for Bug 799299 **/
|
||||
|
||||
function runTests() {
|
||||
window.open("file_bug799299.xul", "_blank", "chrome,width=600,height=550");
|
||||
window.openDialog("file_bug799299.xul", "_blank", "chrome,width=600,height=550,noopener", window);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
|
|
@ -23,14 +23,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=800817
|
|||
var testMozBrowser = false;
|
||||
function runTests() {
|
||||
// Run a first round of tests for non-mozbrowser iframes.
|
||||
window.open("file_bug800817.xul", "_blank", "chrome,width=600,height=550");
|
||||
window.openDialog("file_bug800817.xul", "_blank", "chrome,width=600,height=550,noopener", window);
|
||||
}
|
||||
|
||||
function finishedTests() {
|
||||
if (!testMozBrowser) {
|
||||
testMozBrowser = true;
|
||||
// Run a second round of tests for mozbrowser iframes.
|
||||
window.open("file_bug800817.xul", "_blank", "chrome,width=600,height=550");
|
||||
window.openDialog("file_bug800817.xul", "_blank", "chrome,width=600,height=550,noopener", window);
|
||||
} else {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=830858
|
|||
/** Test for Bug 830858 **/
|
||||
|
||||
function runTests() {
|
||||
window.open("file_bug830858.xul", "_blank", "chrome,width=600,height=550");
|
||||
window.openDialog("file_bug830858.xul", "_blank", "chrome,width=600,height=550,noopener", window);
|
||||
}
|
||||
|
||||
function finishedTests() {
|
||||
|
|
|
@ -11,7 +11,7 @@ SimpleTest.waitForExplicitFinish();
|
|||
function runTest()
|
||||
{
|
||||
SpecialPowers.pushPrefEnv({"set": [['dom.event.clipboardevents.enabled', false]]}, function() {
|
||||
window.open("file_clipboard_events_chrome.html", "_blank", "chrome,width=200,height=200");
|
||||
window.openDialog("file_clipboard_events_chrome.html", "_blank", "chrome,width=200,height=200,noopener", window);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// Create two identical windows, each with a <browser> element.
|
||||
let win1 = window.openDialog("window_docshell_swap.xul", "_blank","chrome,width=300,height=200");
|
||||
let win2 = window.openDialog("window_docshell_swap.xul", "_blank","chrome,width=300,height=200");
|
||||
let win1 = docShell.rootTreeItem.domWindow.openDialog("window_docshell_swap.xul", "_blank","chrome,width=300,height=200");
|
||||
let win2 = docShell.rootTreeItem.domWindow.openDialog("window_docshell_swap.xul", "_blank","chrome,width=300,height=200");
|
||||
|
||||
let loadCount = 0;
|
||||
function loadHandler() {
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче