Bug 1810995 - update BrowserTestUtils.loadURI consumers to use loadURIString (automated) - dom and docshell - r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D167152
This commit is contained in:
Gijs Kruitbosch 2023-01-19 20:16:41 +00:00
parent 38016dd0ff
commit cb015ad1d8
111 changed files with 180 additions and 165 deletions

View File

@ -32,7 +32,7 @@ add_task(async function test() {
// Navigate forwards then backwards. // Navigate forwards then backwards.
let loaded = promiseBrowserLoaded(URL2); let loaded = promiseBrowserLoaded(URL2);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, URL2); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, URL2);
await loaded; await loaded;
loaded = promiseBrowserLoaded(URL1); loaded = promiseBrowserLoaded(URL1);

View File

@ -24,7 +24,7 @@ async function verifyErrorPage(errorPageURL) {
let certErrorLoaded = BrowserTestUtils.waitForErrorPage( let certErrorLoaded = BrowserTestUtils.waitForErrorPage(
gBrowser.selectedBrowser gBrowser.selectedBrowser
); );
BrowserTestUtils.loadURI(gBrowser, errorPageURL); BrowserTestUtils.loadURIString(gBrowser, errorPageURL);
await certErrorLoaded; await certErrorLoaded;
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() { await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
@ -59,7 +59,7 @@ add_task(async function prefixBadCertDomain() {
false, false,
FIXED_URL FIXED_URL
); );
BrowserTestUtils.loadURI(gBrowser, BAD_CERT_DOMAIN_ERROR_URL); BrowserTestUtils.loadURIString(gBrowser, BAD_CERT_DOMAIN_ERROR_URL);
await loadSuccessful; await loadSuccessful;
info("The URL was fixed as expected"); info("The URL was fixed as expected");

View File

@ -65,7 +65,7 @@ async function testWithDomain(domain) {
await closeContextMenu(); await closeContextMenu();
let loaded = BrowserTestUtils.browserLoaded(browser, false, null, true); let loaded = BrowserTestUtils.browserLoaded(browser, false, null, true);
BrowserTestUtils.loadURI(browser, dummyPageURL(domain)); BrowserTestUtils.loadURIString(browser, dummyPageURL(domain));
await loaded; await loaded;
loaded = BrowserTestUtils.waitForLocationChange(gBrowser, dummy); loaded = BrowserTestUtils.waitForLocationChange(gBrowser, dummy);
browser.goBack(); browser.goBack();

View File

@ -24,7 +24,7 @@ add_task(async function() {
const onLocationChanged = waitForNextLocationChange(webProgress); const onLocationChanged = waitForNextLocationChange(webProgress);
const newLocation = "data:text/html;charset=utf-8,first-page"; const newLocation = "data:text/html;charset=utf-8,first-page";
let loaded = BrowserTestUtils.browserLoaded(browser); let loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, newLocation); BrowserTestUtils.loadURIString(browser, newLocation);
await loaded; await loaded;
const firstPageBrowsingContext = browser.browsingContext; const firstPageBrowsingContext = browser.browsingContext;
@ -109,7 +109,7 @@ add_task(async function() {
// eslint-disable-next-line @microsoft/sdl/no-insecure-url // eslint-disable-next-line @microsoft/sdl/no-insecure-url
const secondLocation = "http://example.com/document-builder.sjs?html=com"; const secondLocation = "http://example.com/document-builder.sjs?html=com";
loaded = BrowserTestUtils.browserLoaded(browser); loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, secondLocation); BrowserTestUtils.loadURIString(browser, secondLocation);
await loaded; await loaded;
const secondPageBrowsingContext = browser.browsingContext; const secondPageBrowsingContext = browser.browsingContext;

View File

@ -20,14 +20,14 @@ add_task(async function runTests() {
let browser = tab.linkedBrowser; let browser = tab.linkedBrowser;
let loaded = BrowserTestUtils.browserLoaded(browser); let loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, "about:config"); BrowserTestUtils.loadURIString(browser, "about:config");
let href = await loaded; let href = await loaded;
is(href, "about:config", "Check about:config loaded"); is(href, "about:config", "Check about:config loaded");
// Using a dummy onunload listener to disable the bfcache as that can prevent // Using a dummy onunload listener to disable the bfcache as that can prevent
// the test browser load detection mechanism from working. // the test browser load detection mechanism from working.
loaded = BrowserTestUtils.browserLoaded(browser); loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
browser, browser,
"data:text/html,<body%20onunload=''><iframe></iframe></body>" "data:text/html,<body%20onunload=''><iframe></iframe></body>"
); );

View File

@ -23,7 +23,10 @@ add_task(async function testValidCache() {
}); });
// Load a random page. // Load a random page.
BrowserTestUtils.loadURI(browser, "data:text/html;charset=utf-8,pageA2"); BrowserTestUtils.loadURIString(
browser,
"data:text/html;charset=utf-8,pageA2"
);
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
// Go back and verify text content. // Go back and verify text content.
@ -60,7 +63,10 @@ add_task(async function testExpiredCache() {
}); });
// Load a random page. // Load a random page.
BrowserTestUtils.loadURI(browser, "data:text/html;charset=utf-8,pageB2"); BrowserTestUtils.loadURIString(
browser,
"data:text/html;charset=utf-8,pageB2"
);
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
// Wait for 3 times of expiration timeout, hopefully it's evicted... // Wait for 3 times of expiration timeout, hopefully it's evicted...

View File

@ -132,7 +132,7 @@ add_task(async function test() {
* permitUnload should be true, and all handlers fired. * permitUnload should be true, and all handlers fired.
*/ */
url += "?1"; url += "?1";
BrowserTestUtils.loadURI(browser, url); BrowserTestUtils.loadURIString(browser, url);
await BrowserTestUtils.browserLoaded(browser, false, url); await BrowserTestUtils.browserLoaded(browser, false, url);
await promptShownPromise; await promptShownPromise;

View File

@ -10,7 +10,7 @@ add_task(async function test_backAndReload() {
browser browser
) { ) {
info("Start JSON load."); info("Start JSON load.");
BrowserTestUtils.loadURI(browser, JSON); BrowserTestUtils.loadURIString(browser, JSON);
await BrowserTestUtils.waitForLocationChange(gBrowser, JSON); await BrowserTestUtils.waitForLocationChange(gBrowser, JSON);
info("JSON load has started, go back."); info("JSON load has started, go back.");

View File

@ -12,7 +12,7 @@ add_task(async function test_backAndReload() {
await BrowserTestUtils.crashFrame(browser); await BrowserTestUtils.crashFrame(browser);
info("Start second load."); info("Start second load.");
BrowserTestUtils.loadURI(browser, DUMMY_2); BrowserTestUtils.loadURIString(browser, DUMMY_2);
await BrowserTestUtils.waitForLocationChange(gBrowser, DUMMY_2); await BrowserTestUtils.waitForLocationChange(gBrowser, DUMMY_2);
browser.goBack(); browser.goBack();

View File

@ -20,7 +20,7 @@ add_task(async () => {
); );
info("new tab loaded"); info("new tab loaded");
BrowserTestUtils.loadURI(browser, HTML_URI); BrowserTestUtils.loadURIString(browser, HTML_URI);
await browserLoaded; await browserLoaded;
info("The test page has loaded!"); info("The test page has loaded!");

View File

@ -2,7 +2,7 @@
async function doLoadAndGoBack(browser, ext) { async function doLoadAndGoBack(browser, ext) {
let loaded = BrowserTestUtils.browserLoaded(browser); let loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, "https://example.com/"); BrowserTestUtils.loadURIString(browser, "https://example.com/");
await ext.awaitMessage("redir-handled"); await ext.awaitMessage("redir-handled");
await loaded; await loaded;

View File

@ -21,7 +21,7 @@ add_task(async function() {
info("Initial load"); info("Initial load");
let loaded = BrowserTestUtils.browserLoaded(browser); let loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, url2); BrowserTestUtils.loadURIString(browser, url2);
await loaded; await loaded;
info("Second page loaded"); info("Second page loaded");

View File

@ -22,7 +22,7 @@ add_task(async function testBFCacheEviction() {
await BrowserTestUtils.withNewTab({ gBrowser, url: uri }, async function( await BrowserTestUtils.withNewTab({ gBrowser, url: uri }, async function(
browser browser
) { ) {
BrowserTestUtils.loadURI(browser, uri2); BrowserTestUtils.loadURIString(browser, uri2);
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
let awaitPageShow = BrowserTestUtils.waitForContentEvent( let awaitPageShow = BrowserTestUtils.waitForContentEvent(

View File

@ -26,7 +26,7 @@ add_task(async function test() {
for (var uri of uris) { for (var uri of uris) {
await BrowserTestUtils.withNewTab({ gBrowser }, async function(newBrowser) { await BrowserTestUtils.withNewTab({ gBrowser }, async function(newBrowser) {
let loadedPromise = BrowserTestUtils.browserLoaded(newBrowser); let loadedPromise = BrowserTestUtils.browserLoaded(newBrowser);
BrowserTestUtils.loadURI(newBrowser, uri); BrowserTestUtils.loadURIString(newBrowser, uri);
var prin = newBrowser.contentPrincipal; var prin = newBrowser.contentPrincipal;
isnot( isnot(

View File

@ -119,7 +119,7 @@ add_task(async function test() {
"DOMContentLoaded", "DOMContentLoaded",
true true
).then(onPageLoad); ).then(onPageLoad);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, pageurl); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, pageurl);
await promiseIcon1; await promiseIcon1;
await promiseIcon2; await promiseIcon2;

View File

@ -18,7 +18,7 @@ add_task(async function runTests() {
info("# part 1"); info("# part 1");
await whenPageShown(browser, () => await whenPageShown(browser, () =>
// eslint-disable-next-line @microsoft/sdl/no-insecure-url // eslint-disable-next-line @microsoft/sdl/no-insecure-url
BrowserTestUtils.loadURI(browser, "http://www.example.com/") BrowserTestUtils.loadURIString(browser, "http://www.example.com/")
); );
await checkListenersAsync("newentry", "shistory has a new entry"); await checkListenersAsync("newentry", "shistory has a new entry");
ok(browser.canGoBack, "we can go back"); ok(browser.canGoBack, "we can go back");
@ -121,7 +121,7 @@ add_task(async function runTests() {
info("# part 1"); info("# part 1");
await whenPageShown(browser, () => await whenPageShown(browser, () =>
// eslint-disable-next-line @microsoft/sdl/no-insecure-url // eslint-disable-next-line @microsoft/sdl/no-insecure-url
BrowserTestUtils.loadURI(browser, "http://www.example.com/") BrowserTestUtils.loadURIString(browser, "http://www.example.com/")
); );
checkListeners("newentry", "shistory has a new entry"); checkListeners("newentry", "shistory has a new entry");
ok(browser.canGoBack, "we can go back"); ok(browser.canGoBack, "we can go back");

View File

@ -136,7 +136,7 @@ add_task(async function test() {
}; };
history.addSHistoryListener(listener); history.addSHistoryListener(listener);
BrowserTestUtils.loadURI(browser, URL); BrowserTestUtils.loadURIString(browser, URL);
await testDone.promise; await testDone.promise;
} }

View File

@ -7,7 +7,7 @@ add_task(async function test_dataURI_unique_opaque_origin() {
let pagePrincipal = browser.contentPrincipal; let pagePrincipal = browser.contentPrincipal;
info("pagePrincial " + pagePrincipal.origin); info("pagePrincial " + pagePrincipal.origin);
BrowserTestUtils.loadURI(browser, "data:text/html,hi"); BrowserTestUtils.loadURIString(browser, "data:text/html,hi");
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
await SpecialPowers.spawn( await SpecialPowers.spawn(

View File

@ -20,7 +20,7 @@ add_task(async function test() {
let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, uri, true); let tab2 = await BrowserTestUtils.openNewForegroundTab(gBrowser, uri, true);
let browser2 = tab2.linkedBrowser; let browser2 = tab2.linkedBrowser;
BrowserTestUtils.loadURI(browser2, uri + "nextpage"); BrowserTestUtils.loadURIString(browser2, uri + "nextpage");
await BrowserTestUtils.browserLoaded(browser2, false); await BrowserTestUtils.browserLoaded(browser2, false);
gBrowser.swapBrowsersAndCloseOther(tab1, tab2); gBrowser.swapBrowsersAndCloseOther(tab1, tab2);

View File

@ -16,7 +16,7 @@ add_task(async function test() {
await SpecialPowers.spawn(browser, [], () => { await SpecialPowers.spawn(browser, [], () => {
content.addEventListener("unload", e => e.currentTarget.stop(), true); content.addEventListener("unload", e => e.currentTarget.stop(), true);
}); });
BrowserTestUtils.loadURI(browser, TEST_PAGE_2); BrowserTestUtils.loadURIString(browser, TEST_PAGE_2);
await loaded; await loaded;
ok(true, "Page loaded successfully"); ok(true, "Page loaded successfully");
}); });

View File

@ -30,7 +30,7 @@ add_task(async function target_to_new_blank_browser() {
let win = await BrowserTestUtils.openNewBrowserWindow(); let win = await BrowserTestUtils.openNewBrowserWindow();
let originalTab = win.gBrowser.selectedTab; let originalTab = win.gBrowser.selectedTab;
let originalBrowser = originalTab.linkedBrowser; let originalBrowser = originalTab.linkedBrowser;
BrowserTestUtils.loadURI(originalBrowser, TEST_PAGE); BrowserTestUtils.loadURIString(originalBrowser, TEST_PAGE);
await BrowserTestUtils.browserLoaded(originalBrowser, false, TEST_PAGE); await BrowserTestUtils.browserLoaded(originalBrowser, false, TEST_PAGE);
// Now set the targetTopLevelLinkClicksToBlank property to true, since it // Now set the targetTopLevelLinkClicksToBlank property to true, since it
@ -66,7 +66,7 @@ add_task(async function target_to_new_blank_browser() {
// Now do the same thing with a subframe targeting "_top". This should also // Now do the same thing with a subframe targeting "_top". This should also
// get redirected to "_blank". // get redirected to "_blank".
BrowserTestUtils.loadURI(originalBrowser, TEST_IFRAME_PAGE); BrowserTestUtils.loadURIString(originalBrowser, TEST_IFRAME_PAGE);
await BrowserTestUtils.browserLoaded( await BrowserTestUtils.browserLoaded(
originalBrowser, originalBrowser,
false, false,
@ -124,7 +124,7 @@ add_task(async function target_to_new_blank_browser() {
add_task(async function skip_blank_target_for_some_loads() { add_task(async function skip_blank_target_for_some_loads() {
let win = await BrowserTestUtils.openNewBrowserWindow(); let win = await BrowserTestUtils.openNewBrowserWindow();
let currentBrowser = win.gBrowser.selectedBrowser; let currentBrowser = win.gBrowser.selectedBrowser;
BrowserTestUtils.loadURI(currentBrowser, TEST_PAGE); BrowserTestUtils.loadURIString(currentBrowser, TEST_PAGE);
await BrowserTestUtils.browserLoaded(currentBrowser, false, TEST_PAGE); await BrowserTestUtils.browserLoaded(currentBrowser, false, TEST_PAGE);
// Now set the targetTopLevelLinkClicksToBlank property to true, since it // Now set the targetTopLevelLinkClicksToBlank property to true, since it

View File

@ -13,7 +13,7 @@ add_task(async function chrome_to_content_view_source() {
is(browser.documentURI.spec, "about:mozilla"); is(browser.documentURI.spec, "about:mozilla");
// This process switch would previously crash in debug builds due to assertion failures. // This process switch would previously crash in debug builds due to assertion failures.
BrowserTestUtils.loadURI(browser, TEST_URI); BrowserTestUtils.loadURIString(browser, TEST_URI);
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
is(browser.documentURI.spec, TEST_URI); is(browser.documentURI.spec, TEST_URI);
}); });

View File

@ -10,7 +10,7 @@ const MULTIPART_URI = `${TEST_PATH}file_basic_multipart.sjs`;
add_task(async function viewsource_multipart_uri() { add_task(async function viewsource_multipart_uri() {
await BrowserTestUtils.withNewTab("about:blank", async browser => { await BrowserTestUtils.withNewTab("about:blank", async browser => {
BrowserTestUtils.loadURI(browser, MULTIPART_URI); BrowserTestUtils.loadURIString(browser, MULTIPART_URI);
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
is(browser.currentURI.spec, MULTIPART_URI); is(browser.currentURI.spec, MULTIPART_URI);
@ -30,7 +30,7 @@ add_task(async function viewsource_multipart_uri() {
// Load a view-source version of the page, which should show the full // Load a view-source version of the page, which should show the full
// content, not handling multipart. // content, not handling multipart.
BrowserTestUtils.loadURI(browser, `view-source:${MULTIPART_URI}`); BrowserTestUtils.loadURIString(browser, `view-source:${MULTIPART_URI}`);
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
let viewSourceContent = await SpecialPowers.spawn(browser, [], async () => { let viewSourceContent = await SpecialPowers.spawn(browser, [], async () => {

View File

@ -131,7 +131,7 @@ async function loadURI(url) {
info(`Doing a top-level loadURI, expecting to load ${url}`); info(`Doing a top-level loadURI, expecting to load ${url}`);
let browser = gBrowser.selectedBrowser; let browser = gBrowser.selectedBrowser;
let loaded = BrowserTestUtils.browserLoaded(browser, false, url); let loaded = BrowserTestUtils.browserLoaded(browser, false, url);
BrowserTestUtils.loadURI(browser, url); BrowserTestUtils.loadURIString(browser, url);
await loaded; await loaded;
info(`Loaded ${url}`); info(`Loaded ${url}`);
} }

View File

@ -293,7 +293,7 @@ function doPageNavigation(params) {
TestWindow.getBrowser().gotoIndex(gotoIndex); TestWindow.getBrowser().gotoIndex(gotoIndex);
} else if (uri) { } else if (uri) {
gNavType = NAV_URI; gNavType = NAV_URI;
BrowserTestUtils.loadURI(TestWindow.getBrowser(), uri); BrowserTestUtils.loadURIString(TestWindow.getBrowser(), uri);
} else if (reload) { } else if (reload) {
gNavType = NAV_RELOAD; gNavType = NAV_RELOAD;
TestWindow.getBrowser().reload(); TestWindow.getBrowser().reload();

View File

@ -24,7 +24,7 @@ add_task(async function() {
.setAttribute("onunload", "/* disable bfcache*/"); .setAttribute("onunload", "/* disable bfcache*/");
}); });
BrowserTestUtils.loadURI(browser, testPage2); BrowserTestUtils.loadURIString(browser, testPage2);
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
let pageShownPromise = BrowserTestUtils.waitForContentEvent( let pageShownPromise = BrowserTestUtils.waitForContentEvent(

View File

@ -69,7 +69,10 @@ add_task(async function() {
}); });
// Navigate tab 2 to a different page // Navigate tab 2 to a different page
BrowserTestUtils.loadURI(ctx.tab2Browser, testPath + "bug343515_pg3.html"); BrowserTestUtils.loadURIString(
ctx.tab2Browser,
testPath + "bug343515_pg3.html"
);
await BrowserTestUtils.browserLoaded(ctx.tab2Browser); await BrowserTestUtils.browserLoaded(ctx.tab2Browser);
@ -167,7 +170,10 @@ add_task(async function() {
await BrowserTestUtils.switchTab(gBrowser, ctx.tab1); await BrowserTestUtils.switchTab(gBrowser, ctx.tab1);
// Navigate to page 3 // Navigate to page 3
BrowserTestUtils.loadURI(ctx.tab1Browser, testPath + "bug343515_pg3.html"); BrowserTestUtils.loadURIString(
ctx.tab1Browser,
testPath + "bug343515_pg3.html"
);
await BrowserTestUtils.browserLoaded(ctx.tab1Browser); await BrowserTestUtils.browserLoaded(ctx.tab1Browser);

View File

@ -54,7 +54,7 @@ add_task(async function() {
}); });
// 2. Navigate to URL2 // 2. Navigate to URL2
// We are navigating to a page with the same origin so that we will stay in the same process // We are navigating to a page with the same origin so that we will stay in the same process
BrowserTestUtils.loadURI(browser, URL2); BrowserTestUtils.loadURIString(browser, URL2);
await loadPromise; await loadPromise;
// 3. Reload the browser with specific flags so that we end up here // 3. Reload the browser with specific flags so that we end up here

View File

@ -86,7 +86,7 @@ add_task(async function() {
for (var i = 0; i < 4; i++) { for (var i = 0; i < 4; i++) {
testPage = `data:text/html,<html id='html1'><body id='body1'>${i}</body></html>`; testPage = `data:text/html,<html id='html1'><body id='body1'>${i}</body></html>`;
let pagePromise = BrowserTestUtils.browserLoaded(browser); let pagePromise = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, testPage); BrowserTestUtils.loadURIString(browser, testPage);
await pagePromise; await pagePromise;
} }
// 7. Wait for 'content viewer evicted' event to go off // 7. Wait for 'content viewer evicted' event to go off

View File

@ -31,7 +31,7 @@ add_task(async function() {
); );
let loaded = BrowserTestUtils.browserLoaded(browser, false, PAGE_2); let loaded = BrowserTestUtils.browserLoaded(browser, false, PAGE_2);
BrowserTestUtils.loadURI(browser, PAGE_2); BrowserTestUtils.loadURIString(browser, PAGE_2);
await loaded; await loaded;
Assert.equal( Assert.equal(

View File

@ -20,7 +20,7 @@ add_task(async function test_normal_and_history_loads() {
browser browser
) { ) {
for (let i = 0; i < 2; ++i) { for (let i = 0; i < 2; ++i) {
BrowserTestUtils.loadURI(browser, testPage + "?" + i); BrowserTestUtils.loadURIString(browser, testPage + "?" + i);
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
} }

View File

@ -49,7 +49,7 @@ add_task(async function() {
// //
// We should create a new content process. // We should create a new content process.
expectedChildCount += 1; expectedChildCount += 1;
BrowserTestUtils.loadURI(tabs[0].linkedBrowser, TEST_URL); BrowserTestUtils.loadURIString(tabs[0].linkedBrowser, TEST_URL);
await BrowserTestUtils.browserLoaded(tabs[0].linkedBrowser, false, TEST_URL); await BrowserTestUtils.browserLoaded(tabs[0].linkedBrowser, false, TEST_URL);
is( is(
ppmm.childCount, ppmm.childCount,

View File

@ -25,7 +25,7 @@ add_task(async function() {
} }
// Load file_bug1554070_1.html. // Load file_bug1554070_1.html.
BrowserTestUtils.loadURI(browser, URL0); BrowserTestUtils.loadURIString(browser, URL0);
await BrowserTestUtils.browserLoaded(browser, false, URL0); await BrowserTestUtils.browserLoaded(browser, false, URL0);
is(gBrowser.currentURI.spec, URL0, "loaded file_bug1554070_1.html"); is(gBrowser.currentURI.spec, URL0, "loaded file_bug1554070_1.html");

View File

@ -25,7 +25,7 @@ add_task(async function mixed_content_block_for_target_top_test() {
true, true,
frameUrl frameUrl
); );
BrowserTestUtils.loadURI(testBrowser, url); BrowserTestUtils.loadURIString(testBrowser, url);
await loadPromise; await loadPromise;
await frameLoadPromise; await frameLoadPromise;

View File

@ -16,7 +16,7 @@ add_task(async function testParentProcess() {
add_task(async function testContentProcesses() { add_task(async function testContentProcesses() {
info("Open a tab in a content process"); info("Open a tab in a content process");
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank"); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:blank");
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
info("Sanity checks against all returned elements of getAllDOMProcesses"); info("Sanity checks against all returned elements of getAllDOMProcesses");

View File

@ -143,7 +143,7 @@ add_task(async function() {
); );
// Load something in the main process // Load something in the main process
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:mozilla"); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:mozilla");
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
let init = Services.ppmm.initialProcessData; let init = Services.ppmm.initialProcessData;
@ -169,7 +169,7 @@ add_task(async function() {
gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, { gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, {
remoteType: E10SUtils.DEFAULT_REMOTE_TYPE, remoteType: E10SUtils.DEFAULT_REMOTE_TYPE,
}); });
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank"); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:blank");
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
checkBaseProcessCount( checkBaseProcessCount(

View File

@ -33,7 +33,7 @@ add_task(async function() {
// Perform page load 30 times to trigger the ping being sent // Perform page load 30 times to trigger the ping being sent
for (let i = 0; i < 30; i++) { for (let i = 0; i < 30; i++) {
BrowserTestUtils.loadURI(browser, "https://example.com"); BrowserTestUtils.loadURIString(browser, "https://example.com");
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
} }

View File

@ -117,7 +117,7 @@ const test = Test(async function() {
pageShown = receive("content-page-shown", isData); pageShown = receive("content-page-shown", isData);
let pageHidden = receive("content-page-hidden", isData); let pageHidden = receive("content-page-hidden", isData);
BrowserTestUtils.loadURI(browser1, uri2); BrowserTestUtils.loadURIString(browser1, uri2);
let hiddenPage = await pageHidden; let hiddenPage = await pageHidden;
is(interactiveDocument1, hiddenPage, "loaded document is hidden"); is(interactiveDocument1, hiddenPage, "loaded document is hidden");
@ -150,7 +150,7 @@ const test = Test(async function() {
info("load uri#3"); info("load uri#3");
BrowserTestUtils.loadURI(browser1, uri3); BrowserTestUtils.loadURIString(browser1, uri3);
pageShown = receive("content-page-shown", isData); pageShown = receive("content-page-shown", isData);

View File

@ -35,7 +35,7 @@ async function runTest(url) {
newTab, newTab,
"true" "true"
); );
BrowserTestUtils.loadURI(newBrowser, url); BrowserTestUtils.loadURIString(newBrowser, url);
await promise; await promise;
// Put the tab in the background. // Put the tab in the background.

View File

@ -188,7 +188,7 @@ add_task(async function() {
throw `unexpected type ${test.type}`; throw `unexpected type ${test.type}`;
} }
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
if (test.waitForExplicitFinish) { if (test.waitForExplicitFinish) {

View File

@ -15,7 +15,7 @@ add_task(async function() {
}); });
}); });
BrowserTestUtils.loadURI(tab.linkedBrowser, uri); BrowserTestUtils.loadURIString(tab.linkedBrowser, uri);
let loadedURI = await eventPromise; let loadedURI = await eventPromise;
is(loadedURI, uri, "Should have seen the event for the right URI"); is(loadedURI, uri, "Should have seen the event for the right URI");

View File

@ -25,7 +25,7 @@ add_task(async function test1() {
// Set database version for domain 1 // Set database version for domain 1
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL1); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, testPageURL1);
await waitForMessage(11, gBrowser); await waitForMessage(11, gBrowser);
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
}); });
@ -33,7 +33,7 @@ add_task(async function test1() {
add_task(async function test2() { add_task(async function test2() {
// Set database version for domain 2 // Set database version for domain 2
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL2); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, testPageURL2);
await waitForMessage(11, gBrowser); await waitForMessage(11, gBrowser);
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
}); });
@ -48,7 +48,7 @@ add_task(async function test3() {
add_task(async function test4() { add_task(async function test4() {
// Get database version for domain 1 // Get database version for domain 1
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL3); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, testPageURL3);
await waitForMessage(11, gBrowser); await waitForMessage(11, gBrowser);
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
}); });
@ -56,7 +56,7 @@ add_task(async function test4() {
add_task(async function test5() { add_task(async function test5() {
// Get database version for domain 2 // Get database version for domain 2
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL4); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, testPageURL4);
await waitForMessage(1, gBrowser); await waitForMessage(1, gBrowser);
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
}); });

View File

@ -21,7 +21,7 @@ declTest("contentWindow null when inner window inactive", {
let url = CONTENT_WINDOW_URL + "?2"; let url = CONTENT_WINDOW_URL + "?2";
let loaded = BrowserTestUtils.browserLoaded(browser, false, url); let loaded = BrowserTestUtils.browserLoaded(browser, false, url);
await BrowserTestUtils.loadURI(browser, url); await BrowserTestUtils.loadURIString(browser, url);
await loaded; await loaded;
let result = await actorParent.sendQuery("checkActor"); let result = await actorParent.sendQuery("checkActor");

View File

@ -607,7 +607,7 @@ add_task(async function test_cross_group_navigate() {
let dotOrgChildID = browsingContextChildID(browser.browsingContext); let dotOrgChildID = browsingContextChildID(browser.browsingContext);
// Do a cross-group navigation. // Do a cross-group navigation.
BrowserTestUtils.loadURI(browser, coopPage); BrowserTestUtils.loadURIString(browser, coopPage);
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
let coopChildID = browsingContextChildID(browser.browsingContext); let coopChildID = browsingContextChildID(browser.browsingContext);
@ -865,7 +865,7 @@ add_task(async function test_audio_background_tab() {
"Loading a new tab should make it prioritized." "Loading a new tab should make it prioritized."
); );
let loaded = BrowserTestUtils.browserLoaded(browser, false, page2); let loaded = BrowserTestUtils.browserLoaded(browser, false, page2);
BrowserTestUtils.loadURI(browser, page2); BrowserTestUtils.loadURIString(browser, page2);
await loaded; await loaded;
childID = browsingContextChildID(browser.browsingContext); childID = browsingContextChildID(browser.browsingContext);

View File

@ -30,7 +30,7 @@ add_task(async function() {
// always happens during navigation as required by this test. // always happens during navigation as required by this test.
info("Beginning process switch into file URI process"); info("Beginning process switch into file URI process");
let browserLoaded = BrowserTestUtils.browserLoaded(browser); let browserLoaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, uriString); BrowserTestUtils.loadURIString(browser, uriString);
await prepareToChangeCalled.promise; await prepareToChangeCalled.promise;
// The tab we opened is now midway through process switching. Open another // The tab we opened is now midway through process switching. Open another

View File

@ -49,7 +49,7 @@ async function test_navigation(nextPage, cancelContentJSPref, shouldCancel) {
tab.linkedBrowser, tab.linkedBrowser,
"DOMTitleChanged" "DOMTitleChanged"
); );
BrowserTestUtils.loadURI(gBrowser, nextPage); BrowserTestUtils.loadURIString(gBrowser, nextPage);
const result = await Promise.race([ const result = await Promise.race([
nextPageLoaded, nextPageLoaded,

View File

@ -29,7 +29,7 @@ add_task(async function test_hiding_tooltip() {
false, false,
page2 page2
); );
BrowserTestUtils.loadURI(gBrowser, page2); BrowserTestUtils.loadURIString(gBrowser, page2);
await loaded; await loaded;
await hiding; await hiding;

View File

@ -17,7 +17,7 @@ async function allow_play_for_played_video() {
window.gBrowser, window.gBrowser,
"about:blank" "about:blank"
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, VIDEO_PAGE); BrowserTestUtils.loadURIString(tab.linkedBrowser, VIDEO_PAGE);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser); await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
info("- simulate user-click to start video -"); info("- simulate user-click to start video -");

View File

@ -101,7 +101,7 @@ async function testPlayWithoutUserGesture() {
window.gBrowser, window.gBrowser,
"about:blank" "about:blank"
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, VIDEO_PAGE); BrowserTestUtils.loadURIString(tab.linkedBrowser, VIDEO_PAGE);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser); await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
async function checkAutoplayKeyword() { async function checkAutoplayKeyword() {
@ -145,7 +145,7 @@ async function testPlayWithUserGesture(gesture) {
window.gBrowser, window.gBrowser,
"about:blank" "about:blank"
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, VIDEO_PAGE); BrowserTestUtils.loadURIString(tab.linkedBrowser, VIDEO_PAGE);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser); await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
info("- simulate user gesture -"); info("- simulate user gesture -");

View File

@ -340,7 +340,7 @@ add_task(async function testMetadataAfterTabNavigation() {
info(`navigate tab to blank page`); info(`navigate tab to blank page`);
await Promise.all([ await Promise.all([
new Promise(r => (tab.controller.ondeactivated = r)), new Promise(r => (tab.controller.ondeactivated = r)),
BrowserTestUtils.loadURI(tab.linkedBrowser, "about:blank"), BrowserTestUtils.loadURIString(tab.linkedBrowser, "about:blank"),
]); ]);
info(`current media metadata should be reset`); info(`current media metadata should be reset`);

View File

@ -87,7 +87,7 @@ add_task(async function testActiveSessionWhenNavigatingTab() {
info(`navigate tab2 to blank page`); info(`navigate tab2 to blank page`);
const controllerChanged = waitUntilMainMediaControllerChanged(); const controllerChanged = waitUntilMainMediaControllerChanged();
BrowserTestUtils.loadURI(tab2.linkedBrowser, "about:blank"); BrowserTestUtils.loadURIString(tab2.linkedBrowser, "about:blank");
await controllerChanged; await controllerChanged;
info(`pressing '${ACTION}' key`); info(`pressing '${ACTION}' key`);

View File

@ -27,7 +27,7 @@ function promiseTabLoadEvent(tab, url) {
let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, handle); let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, handle);
if (url) { if (url) {
BrowserTestUtils.loadURI(tab.linkedBrowser, url); BrowserTestUtils.loadURIString(tab.linkedBrowser, url);
} }
return loaded; return loaded;

View File

@ -24,7 +24,7 @@ addTest(async function testPermissionAllow() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
info("Loading test page: " + testPageURL); info("Loading test page: " + testPageURL);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, testPageURL);
await waitForMessage(true, gBrowser); await waitForMessage(true, gBrowser);
is( is(
@ -52,7 +52,7 @@ addTest(async function testNoPermissionPrompt() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
info("Loading test page: " + testPageURL); info("Loading test page: " + testPageURL);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, testPageURL);
await waitForMessage(true, gBrowser); await waitForMessage(true, gBrowser);
is( is(

View File

@ -22,7 +22,7 @@ addTest(async function testPermissionTemporaryDenied() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
info("Loading test page: " + testPageURL); info("Loading test page: " + testPageURL);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, testPageURL);
await waitForMessage(false, gBrowser); await waitForMessage(false, gBrowser);
is( is(
@ -64,7 +64,7 @@ addTest(async function testPermissionDenied() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
info("Loading test page: " + testPageURL); info("Loading test page: " + testPageURL);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, testPageURL);
await waitForMessage(false, gBrowser); await waitForMessage(false, gBrowser);
is( is(
@ -92,7 +92,7 @@ addTest(async function testNoPermissionPrompt() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
info("Loading test page: " + testPageURL); info("Loading test page: " + testPageURL);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, testPageURL);
await waitForMessage(false, gBrowser); await waitForMessage(false, gBrowser);
is( is(
@ -122,7 +122,7 @@ addTest(async function testPermissionDeniedDismiss() {
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser); gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
info("Loading test page: " + testPageURL); info("Loading test page: " + testPageURL);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, testPageURL);
await waitForMessage(false, gBrowser); await waitForMessage(false, gBrowser);
// Pressing ESC results in a temporary block permission on the browser object. // Pressing ESC results in a temporary block permission on the browser object.

View File

@ -37,7 +37,7 @@ addTest(async function testPermissionUnknownInPrivateWindow() {
win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser); win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser);
info("Loading test page: " + testPageURL); info("Loading test page: " + testPageURL);
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, testPageURL); BrowserTestUtils.loadURIString(win.gBrowser.selectedBrowser, testPageURL);
await waitForMessage(false, win.gBrowser); await waitForMessage(false, win.gBrowser);
is( is(

View File

@ -74,7 +74,7 @@ add_task(async function() {
"about:blank" "about:blank"
); );
BrowserTestUtils.loadURI(gBrowser, test_uri); BrowserTestUtils.loadURIString(gBrowser, test_uri);
await BrowserTestUtils.waitForLocationChange( await BrowserTestUtils.waitForLocationChange(
gBrowser, gBrowser,
@ -87,7 +87,7 @@ add_task(async function() {
messages_seen = 0; messages_seen = 0;
let test_two_uri = let test_two_uri =
"http://mochi.test:8888/browser/dom/security/test/cors/file_bug1456721.html"; "http://mochi.test:8888/browser/dom/security/test/cors/file_bug1456721.html";
BrowserTestUtils.loadURI(gBrowser, test_two_uri); BrowserTestUtils.loadURIString(gBrowser, test_two_uri);
await BrowserTestUtils.waitForLocationChange( await BrowserTestUtils.waitForLocationChange(
gBrowser, gBrowser,

View File

@ -32,14 +32,14 @@ add_task(async function bug1748693() {
waitForExplicitFinish(); waitForExplicitFinish();
let loaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); let loaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
gBrowser, gBrowser,
`${HTTPS_PATH}file_same_site_cookies_bug1748693.sjs?setcookies` `${HTTPS_PATH}file_same_site_cookies_bug1748693.sjs?setcookies`
); );
await loaded; await loaded;
loaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); loaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
gBrowser, gBrowser,
`${HTTP_PATH}file_same_site_cookies_bug1748693.sjs` `${HTTP_PATH}file_same_site_cookies_bug1748693.sjs`
); );

View File

@ -31,7 +31,7 @@ add_task(async function() {
Services.console.registerListener(on_new_message); Services.console.registerListener(on_new_message);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, kTestURI); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, kTestURI);
await BrowserTestUtils.waitForCondition(() => seen_files.length === 0); await BrowserTestUtils.waitForCondition(() => seen_files.length === 0);
is(seen_files.length, 0, "All FTP subresources should be blocked"); is(seen_files.length, 0, "All FTP subresources should be blocked");

View File

@ -53,7 +53,7 @@ add_task(async function test_with_downloads_pref_disabled() {
let windowPromise = addWindowListener( let windowPromise = addWindowListener(
"chrome://mozapps/content/downloads/unknownContentType.xhtml" "chrome://mozapps/content/downloads/unknownContentType.xhtml"
); );
BrowserTestUtils.loadURI(gBrowser, kTestURI); BrowserTestUtils.loadURIString(gBrowser, kTestURI);
let win = await windowPromise; let win = await windowPromise;
is( is(
@ -79,7 +79,7 @@ add_task(async function test_with_always_ask_pref_disabled() {
let downloadsPanelPromise = promisePanelOpened(); let downloadsPanelPromise = promisePanelOpened();
let downloadsPromise = Downloads.getList(Downloads.PUBLIC); let downloadsPromise = Downloads.getList(Downloads.PUBLIC);
BrowserTestUtils.loadURI(gBrowser, kTestURI); BrowserTestUtils.loadURIString(gBrowser, kTestURI);
// wait until downloadsPanel opens before continuing with test // wait until downloadsPanel opens before continuing with test
await downloadsPanelPromise; await downloadsPanelPromise;
let downloadList = await downloadsPromise; let downloadList = await downloadsPromise;

View File

@ -46,7 +46,7 @@ add_task(async function test_with_pref_enabled() {
let windowPromise = addWindowListener( let windowPromise = addWindowListener(
"chrome://mozapps/content/downloads/unknownContentType.xhtml" "chrome://mozapps/content/downloads/unknownContentType.xhtml"
); );
BrowserTestUtils.loadURI(gBrowser, kTestURI); BrowserTestUtils.loadURIString(gBrowser, kTestURI);
let win = await windowPromise; let win = await windowPromise;
let expectedValue = "index.csv"; let expectedValue = "index.csv";
@ -73,7 +73,7 @@ add_task(async function test_with_pref_disabled() {
let sourceURLBit = "text/csv;foo,bar,foobar"; let sourceURLBit = "text/csv;foo,bar,foobar";
info("Loading URI for pref enabled"); info("Loading URI for pref enabled");
BrowserTestUtils.loadURI(gBrowser, kTestURI); BrowserTestUtils.loadURIString(gBrowser, kTestURI);
info("Waiting for downloads panel to open"); info("Waiting for downloads panel to open");
await downloadsPanelPromise; await downloadsPanelPromise;
info("Getting downloads info after opening downloads panel"); info("Getting downloads info after opening downloads panel");

View File

@ -20,7 +20,7 @@ add_task(async function open_test_xfo_error_page() {
kTestXFrameOptionsURIFrame, kTestXFrameOptionsURIFrame,
true true
); );
BrowserTestUtils.loadURI(browser, kTestXFrameOptionsURI); BrowserTestUtils.loadURIString(browser, kTestXFrameOptionsURI);
await loaded; await loaded;
await SpecialPowers.spawn(browser, [], async function() { await SpecialPowers.spawn(browser, [], async function() {
@ -40,7 +40,7 @@ add_task(async function open_test_csp_frame_ancestor_error_page() {
kTestFrameAncestorsURIFrame, kTestFrameAncestorsURIFrame,
true true
); );
BrowserTestUtils.loadURI(browser, kTestFrameAncestorsURI); BrowserTestUtils.loadURIString(browser, kTestFrameAncestorsURI);
await loaded; await loaded;
await SpecialPowers.spawn(browser, [], async function() { await SpecialPowers.spawn(browser, [], async function() {

View File

@ -98,7 +98,7 @@ async function testReporting(test) {
test.frame_uri, test.frame_uri,
true true
); );
BrowserTestUtils.loadURI(browser, test.test_uri); BrowserTestUtils.loadURIString(browser, test.test_uri);
await loaded; await loaded;
let { type } = test; let { type } = test;
@ -134,7 +134,7 @@ async function testReporting(test) {
browser = tab.linkedBrowser; browser = tab.linkedBrowser;
loaded = BrowserTestUtils.browserLoaded(browser, true, test.frame_uri, true); loaded = BrowserTestUtils.browserLoaded(browser, true, test.frame_uri, true);
BrowserTestUtils.loadURI(browser, test.test_uri); BrowserTestUtils.loadURIString(browser, test.test_uri);
await loaded; await loaded;
frameBC = await SpecialPowers.spawn(browser, [], async _ => { frameBC = await SpecialPowers.spawn(browser, [], async _ => {
@ -174,7 +174,7 @@ async function testReporting(test) {
browser = tab.linkedBrowser; browser = tab.linkedBrowser;
loaded = BrowserTestUtils.browserLoaded(browser, true, test.frame_uri, true); loaded = BrowserTestUtils.browserLoaded(browser, true, test.frame_uri, true);
BrowserTestUtils.loadURI(browser, test.test_uri); BrowserTestUtils.loadURIString(browser, test.test_uri);
await loaded; await loaded;
frameBC = await SpecialPowers.spawn(browser, [], async _ => { frameBC = await SpecialPowers.spawn(browser, [], async _ => {

View File

@ -24,7 +24,7 @@ add_task(async function open_test_xfo_embed_blocked() {
xfoBlocked = false; xfoBlocked = false;
await BrowserTestUtils.withNewTab("about:blank", async function(browser) { await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
Services.console.registerListener(onXFOMessage); Services.console.registerListener(onXFOMessage);
BrowserTestUtils.loadURI(browser, kTestXFOEmbedURI); BrowserTestUtils.loadURIString(browser, kTestXFOEmbedURI);
await BrowserTestUtils.waitForCondition(() => xfoBlocked); await BrowserTestUtils.waitForCondition(() => xfoBlocked);
Services.console.unregisterListener(onXFOMessage); Services.console.unregisterListener(onXFOMessage);
}); });
@ -34,7 +34,7 @@ add_task(async function open_test_xfo_object_blocked() {
xfoBlocked = false; xfoBlocked = false;
await BrowserTestUtils.withNewTab("about:blank", async function(browser) { await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
Services.console.registerListener(onXFOMessage); Services.console.registerListener(onXFOMessage);
BrowserTestUtils.loadURI(browser, kTestXFOObjectURI); BrowserTestUtils.loadURIString(browser, kTestXFOObjectURI);
await BrowserTestUtils.waitForCondition(() => xfoBlocked); await BrowserTestUtils.waitForCondition(() => xfoBlocked);
Services.console.unregisterListener(onXFOMessage); Services.console.unregisterListener(onXFOMessage);
}); });

View File

@ -112,7 +112,7 @@ async function openPage() {
{ gBrowser, url: "about:blank" }, { gBrowser, url: "about:blank" },
async function(browser) { async function(browser) {
// Load http page // Load http page
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
browser, browser,
`${TEST_PATH_HTTP}file_beforeunload_permit_http.html` `${TEST_PATH_HTTP}file_beforeunload_permit_http.html`
); );
@ -129,8 +129,11 @@ async function openPage() {
is(true, hasInteractedWith, "Simulated successfully user interaction"); is(true, hasInteractedWith, "Simulated successfully user interaction");
// And then navigate away to another site which proves that user won't be asked twice to permit a reload (otherwise the test get timed out) // And then navigate away to another site which proves that user won't be asked twice to permit a reload (otherwise the test get timed out)
// eslint-disable-next-line @microsoft/sdl/no-insecure-url BrowserTestUtils.loadURIString(
BrowserTestUtils.loadURI(browser, "http://self-signed.example.com/"); browser,
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
"http://self-signed.example.com/"
);
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
Assert.ok(true, "Navigated successfully."); Assert.ok(true, "Navigated successfully.");
} }
@ -143,7 +146,7 @@ async function loadPageAndReload(testCase) {
await BrowserTestUtils.withNewTab( await BrowserTestUtils.withNewTab(
{ gBrowser, url: "about:blank" }, { gBrowser, url: "about:blank" },
async function(browser) { async function(browser) {
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
browser, browser,
`${TEST_PATH_HTTP}file_beforeunload_permit_http.html` `${TEST_PATH_HTTP}file_beforeunload_permit_http.html`
); );
@ -172,13 +175,13 @@ async function loadPagesAndUseBackButton() {
await BrowserTestUtils.withNewTab( await BrowserTestUtils.withNewTab(
{ gBrowser, url: "about:blank" }, { gBrowser, url: "about:blank" },
async function(browser) { async function(browser) {
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
browser, browser,
`${TEST_PATH_HTTP}file_beforeunload_permit_http.html` `${TEST_PATH_HTTP}file_beforeunload_permit_http.html`
); );
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
browser, browser,
`${TEST_PATH_HTTP}file_beforeunload_permit_http.html?getASessionHistoryEntry` `${TEST_PATH_HTTP}file_beforeunload_permit_http.html?getASessionHistoryEntry`
); );

View File

@ -40,7 +40,7 @@ add_task(async function() {
}); });
Services.console.registerListener(on_new_message); Services.console.registerListener(on_new_message);
// 1. Upgrade page to https:// // 1. Upgrade page to https://
await BrowserTestUtils.loadURI(gBrowser.selectedBrowser, kTestURI); await BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, kTestURI);
await BrowserTestUtils.waitForCondition(() => tests.length === 0); await BrowserTestUtils.waitForCondition(() => tests.length === 0);

View File

@ -14,7 +14,7 @@ const TEST_PATH_HTTPS = getRootDirectory(gTestPath).replace(
async function runTest(desc, url, expectedURI, excpectedContent) { async function runTest(desc, url, expectedURI, excpectedContent) {
await BrowserTestUtils.withNewTab("about:blank", async function(browser) { await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
let loaded = BrowserTestUtils.browserLoaded(browser, false, null, true); let loaded = BrowserTestUtils.browserLoaded(browser, false, null, true);
BrowserTestUtils.loadURI(browser, url); BrowserTestUtils.loadURIString(browser, url);
await loaded; await loaded;
await SpecialPowers.spawn( await SpecialPowers.spawn(

View File

@ -92,7 +92,7 @@ add_task(async function test_with_downloads_pref_enabled() {
let downloadsPanelPromise = promisePanelOpened(); let downloadsPanelPromise = promisePanelOpened();
let downloadsPromise = Downloads.getList(Downloads.PUBLIC); let downloadsPromise = Downloads.getList(Downloads.PUBLIC);
BrowserTestUtils.loadURI(gBrowser, insecureTestURI); BrowserTestUtils.loadURIString(gBrowser, insecureTestURI);
// wait for downloadsPanel to open before continuing with test // wait for downloadsPanel to open before continuing with test
await downloadsPanelPromise; await downloadsPanelPromise;
let downloadList = await downloadsPromise; let downloadList = await downloadsPromise;

View File

@ -11,7 +11,7 @@ const TIMEOUT_PAGE_URI_HTTP =
async function runPrefTest(aURI, aDesc, aAssertURLStartsWith) { async function runPrefTest(aURI, aDesc, aAssertURLStartsWith) {
await BrowserTestUtils.withNewTab("about:blank", async function(browser) { await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
const loaded = BrowserTestUtils.browserLoaded(browser, false, null, true); const loaded = BrowserTestUtils.browserLoaded(browser, false, null, true);
BrowserTestUtils.loadURI(browser, aURI); BrowserTestUtils.loadURIString(browser, aURI);
await loaded; await loaded;
await ContentTask.spawn(browser, { aDesc, aAssertURLStartsWith }, function({ await ContentTask.spawn(browser, { aDesc, aAssertURLStartsWith }, function({

View File

@ -37,7 +37,7 @@ add_task(async function() {
}); });
Services.console.registerListener(on_new_message); Services.console.registerListener(on_new_message);
// 1. Upgrade page to https:// // 1. Upgrade page to https://
await BrowserTestUtils.loadURI( await BrowserTestUtils.loadURIString(
gBrowser.selectedBrowser, gBrowser.selectedBrowser,
"http://httpsfirst.com" "http://httpsfirst.com"
); );

View File

@ -58,7 +58,7 @@ add_task(async function() {
}); });
Services.console.registerListener(on_new_console_messages); Services.console.registerListener(on_new_console_messages);
await BrowserTestUtils.loadURI( await BrowserTestUtils.loadURIString(
gBrowser.selectedBrowser, gBrowser.selectedBrowser,
`${TEST_PATH_HTTP}file_httpsfirst_speculative_connect.html` `${TEST_PATH_HTTP}file_httpsfirst_speculative_connect.html`
); );

View File

@ -24,7 +24,7 @@ add_task(async function() {
set: [["dom.security.https_first", true]], set: [["dom.security.https_first", true]],
}); });
Services.console.registerListener(on_console_message); Services.console.registerListener(on_console_message);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, kTestURI); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, kTestURI);
await BrowserTestUtils.waitForCondition(() => threeMessagesArrived === 3); await BrowserTestUtils.waitForCondition(() => threeMessagesArrived === 3);

View File

@ -24,7 +24,7 @@ async function testNavigations() {
let url3 = REQUEST_URL + "file_navigation.html?foo3"; let url3 = REQUEST_URL + "file_navigation.html?foo3";
let loaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); let loaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
BrowserTestUtils.loadURI(gBrowser, url1); BrowserTestUtils.loadURIString(gBrowser, url1);
await loaded; await loaded;
// Load another site // Load another site

View File

@ -120,7 +120,7 @@ add_task(async function test_slow_download() {
let downloadsPanelPromise = promisePanelOpened(); let downloadsPanelPromise = promisePanelOpened();
let downloadsPromise = Downloads.getList(Downloads.PUBLIC); let downloadsPromise = Downloads.getList(Downloads.PUBLIC);
BrowserTestUtils.loadURI(gBrowser, TEST_URI); BrowserTestUtils.loadURIString(gBrowser, TEST_URI);
// wait for downloadsPanel to open before continuing with test // wait for downloadsPanel to open before continuing with test
await downloadsPanelPromise; await downloadsPanelPromise;
let downloadList = await downloadsPromise; let downloadList = await downloadsPromise;

View File

@ -4,7 +4,7 @@
async function runTest(desc, url, expectedURI) { async function runTest(desc, url, expectedURI) {
await BrowserTestUtils.withNewTab("about:blank", async function(browser) { await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
let loaded = BrowserTestUtils.browserLoaded(browser, false, null, true); let loaded = BrowserTestUtils.browserLoaded(browser, false, null, true);
BrowserTestUtils.loadURI(browser, url); BrowserTestUtils.loadURIString(browser, url);
await loaded; await loaded;
await SpecialPowers.spawn(browser, [desc, expectedURI], async function( await SpecialPowers.spawn(browser, [desc, expectedURI], async function(

View File

@ -42,7 +42,7 @@ add_task(async function test_https_only_background_request_redirect() {
await BrowserTestUtils.withNewTab("about:blank", async function(browser) { await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
let loaded = BrowserTestUtils.browserLoaded(browser, false, null, true); let loaded = BrowserTestUtils.browserLoaded(browser, false, null, true);
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
browser, browser,
"http://example.com/browser/dom/security/test/https-only/file_background_redirect.sjs?start" "http://example.com/browser/dom/security/test/https-only/file_background_redirect.sjs?start"
); );

View File

@ -90,7 +90,7 @@ add_task(async function() {
}); });
Services.console.registerListener(on_new_message); Services.console.registerListener(on_new_message);
// 1. Upgrade page to https:// // 1. Upgrade page to https://
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, kTestURISuccess); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, kTestURISuccess);
// 2. Make an exempt http:// request // 2. Make an exempt http:// request
let xhr = new XMLHttpRequest(); let xhr = new XMLHttpRequest();
xhr.open("GET", kTestURIExempt, true); xhr.open("GET", kTestURIExempt, true);

View File

@ -93,7 +93,7 @@ async function runTest(test) {
await BrowserTestUtils.withNewTab("about:blank", async function(browser) { await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
let loaded = BrowserTestUtils.browserLoaded(browser); let loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, SERVER_URL(test.topLevelScheme)); BrowserTestUtils.loadURIString(browser, SERVER_URL(test.topLevelScheme));
await loaded; await loaded;

View File

@ -16,7 +16,7 @@ add_task(async function see_hsts_header() {
"https://example.com" "https://example.com"
) + "hsts_headers.sjs"; ) + "hsts_headers.sjs";
Services.obs.addObserver(observer, "http-on-examine-response"); Services.obs.addObserver(observer, "http-on-examine-response");
await BrowserTestUtils.loadURI(gBrowser.selectedBrowser, setHstsUrl); await BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, setHstsUrl);
await BrowserTestUtils.waitForCondition(() => readMessage); await BrowserTestUtils.waitForCondition(() => readMessage);
// Clean up // Clean up
@ -41,7 +41,7 @@ add_task(async function() {
) + "hsts_headers.sjs"; ) + "hsts_headers.sjs";
// 1. Upgrade page to https:// // 1. Upgrade page to https://
await BrowserTestUtils.loadURI(gBrowser.selectedBrowser, RESOURCE_LINK); await BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, RESOURCE_LINK);
await BrowserTestUtils.waitForCondition(() => testFinished); await BrowserTestUtils.waitForCondition(() => testFinished);
@ -60,7 +60,7 @@ add_task(async function() {
Services.obs.addObserver(observer, "http-on-examine-response"); Services.obs.addObserver(observer, "http-on-examine-response");
// reset hsts header // reset hsts header
await BrowserTestUtils.loadURI(gBrowser.selectedBrowser, clearHstsUrl); await BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, clearHstsUrl);
await BrowserTestUtils.waitForCondition(() => readMessage); await BrowserTestUtils.waitForCondition(() => readMessage);
// Clean up // Clean up
Services.obs.removeObserver(observer, "http-on-examine-response"); Services.obs.removeObserver(observer, "http-on-examine-response");

View File

@ -58,7 +58,7 @@ add_task(async function() {
}); });
Services.console.registerListener(on_new_console_messages); Services.console.registerListener(on_new_console_messages);
await BrowserTestUtils.loadURI( await BrowserTestUtils.loadURIString(
gBrowser.selectedBrowser, gBrowser.selectedBrowser,
`${TEST_PATH_HTTP}file_httpsonly_speculative_connect.html` `${TEST_PATH_HTTP}file_httpsonly_speculative_connect.html`
); );

View File

@ -189,7 +189,7 @@ async function runTest(test) {
SERVER_URL(test.expectedTopLevel) + queryString, SERVER_URL(test.expectedTopLevel) + queryString,
false // maybeErrorPage false // maybeErrorPage
); );
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
browser, browser,
SERVER_URL(test.topLevelScheme) + queryString SERVER_URL(test.topLevelScheme) + queryString
); );

View File

@ -21,7 +21,7 @@ add_task(async function() {
await BrowserTestUtils.withNewTab("about:blank", async function(browser) { await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
const loaded = BrowserTestUtils.browserLoaded(browser, false, null, true); const loaded = BrowserTestUtils.browserLoaded(browser, false, null, true);
// 1. Upgrade a page to https:// // 1. Upgrade a page to https://
BrowserTestUtils.loadURI(browser, kTestURI); BrowserTestUtils.loadURIString(browser, kTestURI);
await loaded; await loaded;
await ContentTask.spawn(browser, {}, async args => { await ContentTask.spawn(browser, {}, async args => {
ok( ok(

View File

@ -26,7 +26,7 @@ add_task(async function() {
await BrowserTestUtils.withNewTab("about:blank", async function(browser) { await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
let loaded = BrowserTestUtils.browserLoaded(browser); let loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, WEBSOCKET_DOC_URL); BrowserTestUtils.loadURIString(browser, WEBSOCKET_DOC_URL);
await loaded; await loaded;
await SpecialPowers.spawn(browser, [], async function() { await SpecialPowers.spawn(browser, [], async function() {

View File

@ -22,7 +22,7 @@ add_task(async function() {
}); });
Services.console.registerListener(on_auto_upgrade_message); Services.console.registerListener(on_auto_upgrade_message);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, kTestURI); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, kTestURI);
await BrowserTestUtils.waitForCondition(() => seenAutoUpgradeMessage); await BrowserTestUtils.waitForCondition(() => seenAutoUpgradeMessage);

View File

@ -213,7 +213,7 @@ async function runTestIniFrame(gBrowser, enabled, expectNoConsole) {
Services.console.reset(); Services.console.reset();
BrowserTestUtils.loadURI(browser, referrerURL); BrowserTestUtils.loadURIString(browser, referrerURL);
await BrowserTestUtils.browserLoaded(browser, false, referrerURL); await BrowserTestUtils.browserLoaded(browser, false, referrerURL);
let iframeURL = test.test_url + "?show"; let iframeURL = test.test_url + "?show";
@ -268,7 +268,7 @@ async function runTestForLinkClick(gBrowser, enabled, expectNoConsole) {
Services.console.reset(); Services.console.reset();
BrowserTestUtils.loadURI(browser, referrerURL); BrowserTestUtils.loadURIString(browser, referrerURL);
await BrowserTestUtils.browserLoaded(browser, false, referrerURL); await BrowserTestUtils.browserLoaded(browser, false, referrerURL);
let linkURL = test.test_url + "?show"; let linkURL = test.test_url + "?show";

View File

@ -54,7 +54,7 @@ async function testNavigations() {
// Load initial site // Load initial site
let loaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); let loaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
BrowserTestUtils.loadURI(gBrowser, REQUEST_URL + "?test1"); BrowserTestUtils.loadURIString(gBrowser, REQUEST_URL + "?test1");
await loaded; await loaded;
// Load another site // Load another site

View File

@ -72,7 +72,7 @@ add_task(async function() {
let browserLoadedPromise = BrowserTestUtils.browserLoaded( let browserLoadedPromise = BrowserTestUtils.browserLoaded(
topTab.linkedBrowser topTab.linkedBrowser
); );
BrowserTestUtils.loadURI(topTab.linkedBrowser, TOP_EMPTY_PAGE); BrowserTestUtils.loadURIString(topTab.linkedBrowser, TOP_EMPTY_PAGE);
await browserLoadedPromise; await browserLoadedPromise;
// Create Iframe in the top-level page and verify its state. // Create Iframe in the top-level page and verify its state.
@ -92,7 +92,7 @@ add_task(async function() {
// ## Cleanup // ## Cleanup
info("Loading the SW unregister page: " + SW_REGISTER_PAGE); info("Loading the SW unregister page: " + SW_REGISTER_PAGE);
browserLoadedPromise = BrowserTestUtils.browserLoaded(topTab.linkedBrowser); browserLoadedPromise = BrowserTestUtils.browserLoaded(topTab.linkedBrowser);
BrowserTestUtils.loadURI(topTab.linkedBrowser, SW_REGISTER_PAGE); BrowserTestUtils.loadURIString(topTab.linkedBrowser, SW_REGISTER_PAGE);
await browserLoadedPromise; await browserLoadedPromise;
await SpecialPowers.spawn(topTab.linkedBrowser, [], async function() { await SpecialPowers.spawn(topTab.linkedBrowser, [], async function() {

View File

@ -57,7 +57,7 @@ add_task(async function() {
let browserLoadedPromise = BrowserTestUtils.browserLoaded( let browserLoadedPromise = BrowserTestUtils.browserLoaded(
topTab.linkedBrowser topTab.linkedBrowser
); );
BrowserTestUtils.loadURI(topTab.linkedBrowser, TOP_EMPTY_PAGE); BrowserTestUtils.loadURIString(topTab.linkedBrowser, TOP_EMPTY_PAGE);
await browserLoadedPromise; await browserLoadedPromise;
// Create Iframe in the top-level page and verify its state. // Create Iframe in the top-level page and verify its state.
@ -93,7 +93,7 @@ add_task(async function() {
info("Loading the SW unregister page: " + SW_REGISTER_PAGE); info("Loading the SW unregister page: " + SW_REGISTER_PAGE);
browserLoadedPromise = BrowserTestUtils.browserLoaded(topTab.linkedBrowser); browserLoadedPromise = BrowserTestUtils.browserLoaded(topTab.linkedBrowser);
BrowserTestUtils.loadURI(topTab.linkedBrowser, SW_REGISTER_PAGE); BrowserTestUtils.loadURIString(topTab.linkedBrowser, SW_REGISTER_PAGE);
await browserLoadedPromise; await browserLoadedPromise;
await SpecialPowers.spawn(topTab.linkedBrowser, [], async function() { await SpecialPowers.spawn(topTab.linkedBrowser, [], async function() {

View File

@ -90,7 +90,7 @@ function test() {
return downloadList.addView(downloadListener); return downloadList.addView(downloadListener);
}) })
.then(function() { .then(function() {
BrowserTestUtils.loadURI(gBrowser, url); BrowserTestUtils.loadURIString(gBrowser, url);
}); });
} }
); );

View File

@ -81,7 +81,7 @@ function test() {
var tab = BrowserTestUtils.addTab(gBrowser); var tab = BrowserTestUtils.addTab(gBrowser);
var tabBrowser = gBrowser.getBrowserForTab(tab); var tabBrowser = gBrowser.getBrowserForTab(tab);
gBrowser.selectedTab = tab; gBrowser.selectedTab = tab;
BrowserTestUtils.loadURI(gBrowser, url); BrowserTestUtils.loadURIString(gBrowser, url);
} }
); );
} }

View File

@ -35,7 +35,7 @@ const TESTCASES = [
]; ];
async function navigateTab(aTab, aUrl) { async function navigateTab(aTab, aUrl) {
BrowserTestUtils.loadURI(aTab.linkedBrowser, aUrl); BrowserTestUtils.loadURIString(aTab.linkedBrowser, aUrl);
await BrowserTestUtils.waitForLocationChange(gBrowser, aUrl).then(() => await BrowserTestUtils.waitForLocationChange(gBrowser, aUrl).then(() =>
BrowserTestUtils.browserStopped(aTab.linkedBrowser) BrowserTestUtils.browserStopped(aTab.linkedBrowser)

View File

@ -22,7 +22,7 @@ const SW_SCRIPT_URL = `${SAME_ORIGIN_ROOT}simple_fetch_worker.js`;
const SCRIPT_URL = `${SAME_ORIGIN_ROOT}empty.js`; const SCRIPT_URL = `${SAME_ORIGIN_ROOT}empty.js`;
async function navigateTab(aTab, aUrl) { async function navigateTab(aTab, aUrl) {
BrowserTestUtils.loadURI(aTab.linkedBrowser, aUrl); BrowserTestUtils.loadURIString(aTab.linkedBrowser, aUrl);
await BrowserTestUtils.waitForLocationChange(gBrowser, aUrl).then(() => await BrowserTestUtils.waitForLocationChange(gBrowser, aUrl).then(() =>
BrowserTestUtils.browserStopped(aTab.linkedBrowser) BrowserTestUtils.browserStopped(aTab.linkedBrowser)

View File

@ -64,7 +64,7 @@ add_task(async function() {
let browserLoadedPromise = BrowserTestUtils.browserLoaded( let browserLoadedPromise = BrowserTestUtils.browserLoaded(
topTab.linkedBrowser topTab.linkedBrowser
); );
BrowserTestUtils.loadURI(topTab.linkedBrowser, SW_REGISTER_PAGE); BrowserTestUtils.loadURIString(topTab.linkedBrowser, SW_REGISTER_PAGE);
await browserLoadedPromise; await browserLoadedPromise;
info("Create a target iframe: " + SW_IFRAME_PAGE); info("Create a target iframe: " + SW_IFRAME_PAGE);
@ -103,7 +103,7 @@ add_task(async function() {
// Step 4. // Step 4.
info("Loading the SW unregister page: " + SW_REGISTER_PAGE); info("Loading the SW unregister page: " + SW_REGISTER_PAGE);
browserLoadedPromise = BrowserTestUtils.browserLoaded(topTab.linkedBrowser); browserLoadedPromise = BrowserTestUtils.browserLoaded(topTab.linkedBrowser);
BrowserTestUtils.loadURI(topTab.linkedBrowser, SW_REGISTER_PAGE); BrowserTestUtils.loadURIString(topTab.linkedBrowser, SW_REGISTER_PAGE);
await browserLoadedPromise; await browserLoadedPromise;
await SpecialPowers.spawn(topTab.linkedBrowser, [], async function() { await SpecialPowers.spawn(topTab.linkedBrowser, [], async function() {

View File

@ -36,7 +36,7 @@ const CROSS_ORIGIN_REDIRECT_URL = `${TEST_ROOT}redirect.sjs?${CROSS_ORIGIN_URL}`
async function loadURI(aXULBrowser, aURI) { async function loadURI(aXULBrowser, aURI) {
const browserLoadedPromise = BrowserTestUtils.browserLoaded(aXULBrowser); const browserLoadedPromise = BrowserTestUtils.browserLoaded(aXULBrowser);
BrowserTestUtils.loadURI(aXULBrowser, aURI); BrowserTestUtils.loadURIString(aXULBrowser, aURI);
return browserLoadedPromise; return browserLoadedPromise;
} }

View File

@ -61,7 +61,7 @@ function test() {
storageShouldOccur = true; storageShouldOccur = true;
innerID = getInnerWindowId(aWindow); innerID = getInnerWindowId(aWindow);
beforeEvents = ConsoleAPIStorage.getEvents(innerID); beforeEvents = ConsoleAPIStorage.getEvents(innerID);
BrowserTestUtils.loadURI(aWindow.gBrowser.selectedBrowser, testURI); BrowserTestUtils.loadURIString(aWindow.gBrowser.selectedBrowser, testURI);
} }
function testOnWindow(aOptions, aCallback) { function testOnWindow(aOptions, aCallback) {

View File

@ -17,7 +17,7 @@ add_task(async function() {
/* includesubframes */ false, /* includesubframes */ false,
URL URL
); );
BrowserTestUtils.loadURI(backgroundTab.linkedBrowser, URL); BrowserTestUtils.loadURIString(backgroundTab.linkedBrowser, URL);
await loadedPromise; await loadedPromise;
// Get active element in the tab. // Get active element in the tab.

View File

@ -5,7 +5,7 @@ add_task(async function() {
"data:text/html,<!DOCTYPE html><html><body><input autofocus><button autofocus></button><textarea autofocus></textarea><select autofocus></select></body></html>"; "data:text/html,<!DOCTYPE html><html><body><input autofocus><button autofocus></button><textarea autofocus></textarea><select autofocus></select></body></html>";
let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
await loadedPromise; await loadedPromise;
await new Promise(resolve => executeSoon(resolve)); await new Promise(resolve => executeSoon(resolve));

View File

@ -64,7 +64,7 @@ add_task(async function() {
await injectBeforeUnload(browser); await injectBeforeUnload(browser);
// Navigate to a chrome page. // Navigate to a chrome page.
let dialogShown1 = awaitAndCloseBeforeUnloadDialog(browser, false); let dialogShown1 = awaitAndCloseBeforeUnloadDialog(browser, false);
BrowserTestUtils.loadURI(browser, "about:support"); BrowserTestUtils.loadURIString(browser, "about:support");
await Promise.all([dialogShown1, BrowserTestUtils.browserLoaded(browser)]); await Promise.all([dialogShown1, BrowserTestUtils.browserLoaded(browser)]);
is(beforeUnloadCount, 1, "Should have received one beforeunload event."); is(beforeUnloadCount, 1, "Should have received one beforeunload event.");
@ -119,7 +119,7 @@ add_task(async function() {
// Navigate to a content page. // Navigate to a content page.
let dialogShown1 = awaitAndCloseBeforeUnloadDialog(false); let dialogShown1 = awaitAndCloseBeforeUnloadDialog(false);
BrowserTestUtils.loadURI(browser, TEST_URL); BrowserTestUtils.loadURIString(browser, TEST_URL);
await Promise.all([dialogShown1, BrowserTestUtils.browserLoaded(browser)]); await Promise.all([dialogShown1, BrowserTestUtils.browserLoaded(browser)]);
is(beforeUnloadCount, 1, "Should have received one beforeunload event."); is(beforeUnloadCount, 1, "Should have received one beforeunload event.");
ok(browser.isRemoteBrowser, "Browser should be remote."); ok(browser.isRemoteBrowser, "Browser should be remote.");

View File

@ -82,7 +82,7 @@ add_task(async function() {
let browserTest = winTest.gBrowser; let browserTest = winTest.gBrowser;
info(`loading test page: ${testPageURL}`); info(`loading test page: ${testPageURL}`);
BrowserTestUtils.loadURI(browserTest.selectedBrowser, testPageURL); BrowserTestUtils.loadURIString(browserTest.selectedBrowser, testPageURL);
await BrowserTestUtils.browserLoaded(browserTest.selectedBrowser); await BrowserTestUtils.browserLoaded(browserTest.selectedBrowser);
info("test init visibility state"); info("test init visibility state");

View File

@ -33,7 +33,7 @@ add_task(async function() {
let tab = win.gBrowser.selectedTab; let tab = win.gBrowser.selectedTab;
let browser = tab.linkedBrowser; let browser = tab.linkedBrowser;
BrowserTestUtils.loadURI(browser, URL1); BrowserTestUtils.loadURIString(browser, URL1);
await BrowserTestUtils.browserLoaded(browser, false, URL1); await BrowserTestUtils.browserLoaded(browser, false, URL1);
async function loadURL(url) { async function loadURL(url) {

View File

@ -11,7 +11,7 @@ const URL = `${ORIGIN}/${PATH}`;
add_task(async function() { add_task(async function() {
await BrowserTestUtils.withNewTab(URL, async function(browser) { await BrowserTestUtils.withNewTab(URL, async function(browser) {
BrowserTestUtils.loadURI(browser, URL); BrowserTestUtils.loadURIString(browser, URL);
await BrowserTestUtils.browserLoaded(browser); await BrowserTestUtils.browserLoaded(browser);
await SpecialPowers.spawn(browser, [ORIGIN], async origin => { await SpecialPowers.spawn(browser, [ORIGIN], async origin => {

Some files were not shown because too many files have changed in this diff Show More