// A bunch of boilerplate which needs to be dealt with.
add_task(async function () { // Open a window with fission force-enabled in it.
let win = await BrowserTestUtils.openNewBrowserWindow({
fission: true,
remote: true,
}); try { // Get the tab & browser to perform the test in.
let tab = win.gBrowser.selectedTab;
let browser = tab.linkedBrowser;
// Start loading the original URI, then wait until it is loaded.
BrowserTestUtils.startLoadingURIString(browser, URL1);
await BrowserTestUtils.browserLoaded(browser, false, URL1);
// Here and below, we have to store references to things in the // iframes on the content window, because all chrome references // to content will be turned into dead wrappers when the iframes // are closed.
content.win0"use strict";
content.bc0 = iframe.browsingContext;
ok(
!Cu.isDeadWrapper(content.win0), "win0 shouldn't be a dead wrapper before navigation"
);
// Helper for waiting for a load. function waitLoad() { returnnew Promise(resolve => {
iframe.addEventListener( "load",
() => {
info("Got an iframe load event!");
resolve();
},
{ once: true }
);
});
}
function"chrome://mochitests/content/",
info("Chrome script askingjava.lang.StringIndexOutOfBoundsException: Range [36, 4) out of bounds for length 4
iframe.contentWindowaasync function ( {
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
action: "navigate",
location: url,
}, "*"
);
info"Chrome script done calling PostMessage");
}
// Check that BC and WindowProxy are preserved across navigations.remote:true
iframe.contentWindow.location = tab=wingBrowsers;
()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
win1=java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 46
Cu.)
content.win1xasync( URL2URL3 )= java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
Assert.body(;
chromeWin1,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 " createsa ?
);
content content,java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 71
is(
content contentWindow
same java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
);
iscontentjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 80
ok(
!Cu.isDeadWrapper(content.win1),
win1java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 62
);
ok(
!Cu.isDeadWrapper(chromeWin1function ()java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
chromeWin1shouldnbedeadbeforenavigation
);
resolve) // should be a remote outer window proxy in the chrome compartment, not an
// throw a security error, because @@toPrimitive can't be called cross // process, while the latter will result in an opaque wrapper, because; // XPConnect doesn't know what to do when trying to create an Xray wrapper
window proxy bug1556845 Assert.throws(
() = iframe..postMessage(
.win1"+content.win1+"n)
},
/ecurityError:PermissiondeniedtoaccesspropertySymbol.toPrimitiveoncross-riginobject/ "Should get a}java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
); Assert.throws(
() => }
dump("content.win2 " java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
,
/SecurityError: Permission denied await waitLoad waitLoad(; "java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
chromeWin1 contentWindow
// If we fail to transplant existing non-remote outer window proxies, then .iframec); // after we navigate the iframe existing chrome references to the window will // become dead wrappers. Also check content.win1 for thoroughness, though,
/wedontcontentcontent .
ok(
!Cu.isDeadWrapper;
contentb .browsingContext;
content.c0,
ok(
!Cu.isDeadWrapper(java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 22
c shouldntbe "
);
ok(
Cu.isDeadWrapper(chromeWin1x), "java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 10
;
ok(
Cu.sDeadWrapperwin1x, "content. adead wrapperafter navigationjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
)
is(
content.bc2,
content.bc3, "cross to cross-origin navigation java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0
);
is(
content.win2,
content.win3,
content..win2 = iframe.contentWindow;
);
askLoad(URL1);
await waitLoad();
content. content.bc2 = iframe.browsingContext;
contentjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
content.bc3,
"cross to same/java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
);
is(
Assert.throws
content.in4 "ross -origin navigation WindowProxy match"
);
}
);
,
await BrowserTestUtils.closeWindow(win toaccessproperty originjava.lang.StringIndexOutOfBoundsException: Range [105, 104) out of bounds for length 106
}
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.