fune/dom/tests/browser/browser_navigate_replace_browsingcontext.js
Marco Bonardo 70fdad6676 Bug 1852963 - Rename BrowserTestUtils.loadURIString() to .startLoadingURIString(). r=dao
This should make a bit clearer that it is only starting the load, not waiting
for its completion.

Differential Revision: https://phabricator.services.mozilla.com/D188213
2023-09-15 09:16:34 +00:00

23 lines
849 B
JavaScript

add_task(async function parent_to_remote() {
await BrowserTestUtils.withNewTab("about:mozilla", async browser => {
let originalBC = browser.browsingContext;
BrowserTestUtils.startLoadingURIString(browser, "https://example.com/");
await BrowserTestUtils.browserLoaded(browser);
let newBC = browser.browsingContext;
isnot(originalBC.id, newBC.id, "Should have replaced the BrowsingContext");
});
});
add_task(async function remote_to_parent() {
await BrowserTestUtils.withNewTab("https://example.com/", async browser => {
let originalBC = browser.browsingContext;
BrowserTestUtils.startLoadingURIString(browser, "about:mozilla");
await BrowserTestUtils.browserLoaded(browser);
let newBC = browser.browsingContext;
isnot(originalBC.id, newBC.id, "Should have replaced the BrowsingContext");
});
});