add_task(async function () { // (1) Load one page with bfcache disabled and another one with bfcache enabled. // (2) Check that BrowsingContext.getCurrentTopByBrowserId(browserId) returns // the expected browsing context both in the parent process and in the child process. // (3) Go back and then forward // (4) Run the same checks as in step 2 again.
let url1 = "data:text/html,";
let url2 = "data:text/html,page2";
await BrowserTestUtils.withNewTab(
{
gBrowser,
url: url1,
},
async function (browser) {
info("Initial load");
let browserId = browser.browserId;
ok(!!browser.browsingContext, "Should have a BrowsingContext. (1)");
is(
BrowsingContext.getCurrentTopByBrowserId(browserId),
browser.browsingContext, "Should get the correct browsingContext(1)"
);
ok(!!browser.browsingContext, "Should have a BrowsingContext. (2)");
is(
BrowsingContext.getCurrentTopByBrowserId(browserId),
browser.browsingContext, "Should get the correct BrowsingContext. (2)"
);
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 ist noch experimentell.