Bug 1810995 - update BrowserTestUtils.loadURI consumers to use loadURIString (automated) - other directories - r=Standard8,webdriver-reviewers,whimboo

Differential Revision: https://phabricator.services.mozilla.com/D167154
This commit is contained in:
Gijs Kruitbosch 2023-01-19 20:16:43 +00:00
parent 9946c4fcbb
commit 8be066753c
32 changed files with 56 additions and 56 deletions

View File

@ -43,7 +43,7 @@ async function runTests(browser, accDoc) {
], ],
}); });
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
browser, browser,
`data:text/html;charset=utf-8, `data:text/html;charset=utf-8,
<html><body id="body2"> <html><body id="body2">
@ -59,7 +59,7 @@ async function runTests(browser, accDoc) {
[EVENT_REORDER, getAccessible(browser)], [EVENT_REORDER, getAccessible(browser)],
]); ]);
BrowserTestUtils.loadURI(browser, "about:about"); BrowserTestUtils.loadURIString(browser, "about:about");
await onLoadEvents; await onLoadEvents;
@ -79,7 +79,7 @@ async function runTests(browser, accDoc) {
[EVENT_REORDER, getAccessible(browser)], [EVENT_REORDER, getAccessible(browser)],
]); ]);
BrowserTestUtils.loadURI(browser, "about:mozilla"); BrowserTestUtils.loadURIString(browser, "about:mozilla");
await onLoadEvents; await onLoadEvents;
@ -101,7 +101,7 @@ async function runTests(browser, accDoc) {
]); ]);
// eslint-disable-next-line @microsoft/sdl/no-insecure-url // eslint-disable-next-line @microsoft/sdl/no-insecure-url
BrowserTestUtils.loadURI(browser, "http://www.wronguri.wronguri/"); BrowserTestUtils.loadURIString(browser, "http://www.wronguri.wronguri/");
await onLoadEvents; await onLoadEvents;
@ -111,7 +111,7 @@ async function runTests(browser, accDoc) {
[EVENT_REORDER, getAccessible(browser)], [EVENT_REORDER, getAccessible(browser)],
]); ]);
BrowserTestUtils.loadURI(browser, "https://nocert.example.com:443/"); BrowserTestUtils.loadURIString(browser, "https://nocert.example.com:443/");
await onLoadEvents; await onLoadEvents;
} }

View File

@ -19,7 +19,7 @@ function caretMoveChecker(target, caretOffset) {
async function checkURLBarCaretEvents() { async function checkURLBarCaretEvents() {
const kURL = "about:mozilla"; const kURL = "about:mozilla";
let newWin = await BrowserTestUtils.openNewBrowserWindow(); let newWin = await BrowserTestUtils.openNewBrowserWindow();
BrowserTestUtils.loadURI(newWin.gBrowser.selectedBrowser, kURL); BrowserTestUtils.loadURIString(newWin.gBrowser.selectedBrowser, kURL);
newWin.gBrowser.selectedBrowser.focus(); newWin.gBrowser.selectedBrowser.focus();
await waitForEvent(EVENT_DOCUMENT_LOAD_COMPLETE, event => { await waitForEvent(EVENT_DOCUMENT_LOAD_COMPLETE, event => {

View File

@ -30,7 +30,7 @@ add_task(async function() {
}) })
.catch(function() {}); .catch(function() {});
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, URL); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, URL);
// wait until the page and its iframe page is loaded // wait until the page and its iframe page is loaded
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, true, URL); await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, true, URL);

View File

@ -19,7 +19,7 @@ add_task(async function() {
true, true,
`${FOLDER}post.html` `${FOLDER}post.html`
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, `${FOLDER}post.html`); BrowserTestUtils.loadURIString(tab.linkedBrowser, `${FOLDER}post.html`);
await browserLoadedPromise; await browserLoadedPromise;
let finalLoadPromise = BrowserTestUtils.browserLoaded( let finalLoadPromise = BrowserTestUtils.browserLoaded(

View File

@ -58,7 +58,7 @@ add_task(async function() {
true, true,
actionURI actionURI
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, postURI); BrowserTestUtils.loadURIString(tab.linkedBrowser, postURI);
await browserLoadedPromise; await browserLoadedPromise;
var actionFileContentAfter = await IOUtils.readUTF8(actionPath); var actionFileContentAfter = await IOUtils.readUTF8(actionPath);

View File

@ -330,7 +330,7 @@ async function loadURL(url, expectedURL = undefined) {
const browser = gBrowser.selectedTab.linkedBrowser; const browser = gBrowser.selectedTab.linkedBrowser;
const loaded = BrowserTestUtils.browserLoaded(browser, true, expectedURL); const loaded = BrowserTestUtils.browserLoaded(browser, true, expectedURL);
BrowserTestUtils.loadURI(browser, url); BrowserTestUtils.loadURIString(browser, url);
await loaded; await loaded;
} }

View File

@ -199,7 +199,7 @@ async function assertOfflineNavigationFails() {
const browser = gBrowser.selectedTab.linkedBrowser; const browser = gBrowser.selectedTab.linkedBrowser;
let netErrorLoaded = BrowserTestUtils.waitForErrorPage(browser); let netErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
BrowserTestUtils.loadURI(browser, pageEmptyURL); BrowserTestUtils.loadURIString(browser, pageEmptyURL);
await netErrorLoaded; await netErrorLoaded;
} }

View File

@ -128,6 +128,6 @@ function navigateToAnchor(baseUrl, hash) {
gBrowser, gBrowser,
url url
); );
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
return onLocationChange; return onLocationChange;
} }

View File

@ -75,7 +75,7 @@ add_task(async function testDefault({ Security }) {
for (const url of BAD_CERTS) { for (const url of BAD_CERTS) {
info(`Navigating to ${url}`); info(`Navigating to ${url}`);
const loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser); const loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
await loaded; await loaded;
is( is(
@ -94,7 +94,7 @@ add_task(async function testIgnore({ client }) {
for (const url of BAD_CERTS) { for (const url of BAD_CERTS) {
info(`Navigating to ${url}`); info(`Navigating to ${url}`);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
is( is(
@ -114,7 +114,7 @@ add_task(async function testUnignore({ client }) {
for (const url of BAD_CERTS) { for (const url of BAD_CERTS) {
info(`Navigating to ${url}`); info(`Navigating to ${url}`);
const loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser); const loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
await loaded; await loaded;
is( is(
@ -135,7 +135,7 @@ add_task(async function testToggle({ client }) {
await Security.setIgnoreCertificateErrors({ ignore: true }); await Security.setIgnoreCertificateErrors({ ignore: true });
info(`Navigating to ${UNTRUSTED} having set the override`); info(`Navigating to ${UNTRUSTED} having set the override`);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, UNTRUSTED); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, UNTRUSTED);
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
is( is(
@ -150,7 +150,7 @@ add_task(async function testToggle({ client }) {
info(`Navigating to ${UNTRUSTED} having unset the override`); info(`Navigating to ${UNTRUSTED} having unset the override`);
loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser); loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, UNTRUSTED); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, UNTRUSTED);
await loaded; await loaded;
is( is(

View File

@ -63,7 +63,7 @@ async function doGC() {
*/ */
async function loadURL(browser, url) { async function loadURL(browser, url) {
const loaded = BrowserTestUtils.browserLoaded(browser); const loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, url); BrowserTestUtils.loadURIString(browser, url);
return loaded; return loaded;
} }

View File

@ -182,7 +182,7 @@ add_task(async function test_sessionDataRootOnlyModule() {
const rootMessageHandler = createRootMessageHandler(sessionId); const rootMessageHandler = createRootMessageHandler(sessionId);
ok(rootMessageHandler, "Valid ROOT MessageHandler created"); ok(rootMessageHandler, "Valid ROOT MessageHandler created");
await BrowserTestUtils.loadURI( await BrowserTestUtils.loadURIString(
gBrowser, gBrowser,
"https://example.com/document-builder.sjs?html=tab" "https://example.com/document-builder.sjs?html=tab"
); );

View File

@ -30,7 +30,7 @@ function createRootMessageHandler(sessionId) {
*/ */
async function loadURL(browser, url) { async function loadURL(browser, url) {
const loaded = BrowserTestUtils.browserLoaded(browser); const loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, url); BrowserTestUtils.loadURIString(browser, url);
return loaded; return loaded;
} }

View File

@ -22,7 +22,7 @@ add_task(async function test_getBrowsingContextById() {
info(`Navigate to ${TEST_URL}`); info(`Navigate to ${TEST_URL}`);
const loaded = BrowserTestUtils.browserLoaded(browser); const loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, TEST_URL); BrowserTestUtils.loadURIString(browser, TEST_URL);
await loaded; await loaded;
const contexts = browser.browsingContext.getAllBrowsingContextsInSubtree(); const contexts = browser.browsingContext.getAllBrowsingContextsInSubtree();
@ -135,7 +135,7 @@ add_task(async function test_getTabForBrowsingContext() {
info(`Navigate to ${TEST_URL}`); info(`Navigate to ${TEST_URL}`);
const loaded = BrowserTestUtils.browserLoaded(browser); const loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, TEST_URL); BrowserTestUtils.loadURIString(browser, TEST_URL);
await loaded; await loaded;
const contexts = browser.browsingContext.getAllBrowsingContextsInSubtree(); const contexts = browser.browsingContext.getAllBrowsingContextsInSubtree();

View File

@ -39,7 +39,7 @@ function test() {
certOverrideService.clearValidityOverride(INVALID_CERT_DOMAIN, -1, {}); certOverrideService.clearValidityOverride(INVALID_CERT_DOMAIN, -1, {});
}); });
BrowserTestUtils.loadURI(gBrowser, INVALID_CERT_LOCATION); BrowserTestUtils.loadURIString(gBrowser, INVALID_CERT_LOCATION);
let loaded = await BrowserTestUtils.browserLoaded( let loaded = await BrowserTestUtils.browserLoaded(
gBrowser, gBrowser,
false, false,

View File

@ -48,7 +48,7 @@ function test() {
} }
); );
BrowserTestUtils.loadURI(aWindow.gBrowser.selectedBrowser, testURI); BrowserTestUtils.loadURIString(aWindow.gBrowser.selectedBrowser, testURI);
} }
function testOnWindow(aOptions, aCallback) { function testOnWindow(aOptions, aCallback) {

View File

@ -39,7 +39,7 @@ async function testHelper(connectURL, expectedURL) {
set: [["security.default_personal_cert", "Ask Every Time"]], set: [["security.default_personal_cert", "Ask Every Time"]],
}); });
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, connectURL); BrowserTestUtils.loadURIString(win.gBrowser.selectedBrowser, connectURL);
await BrowserTestUtils.browserLoaded( await BrowserTestUtils.browserLoaded(
win.gBrowser.selectedBrowser, win.gBrowser.selectedBrowser,

View File

@ -181,7 +181,7 @@ async function testHelper(
let win = await BrowserTestUtils.openNewBrowserWindow(options); let win = await BrowserTestUtils.openNewBrowserWindow(options);
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
win.gBrowser.selectedBrowser, win.gBrowser.selectedBrowser,
"https://requireclientcert.example.com:443" "https://requireclientcert.example.com:443"
); );

View File

@ -29,7 +29,7 @@ add_setup(async function() {
async function testDeviceConnected(deviceName) { async function testDeviceConnected(deviceName) {
info("testDeviceConnected with deviceName=" + deviceName); info("testDeviceConnected with deviceName=" + deviceName);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:mozilla"); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:mozilla");
await waitForDocLoadComplete(); await waitForDocLoadComplete();
let waitForTabPromise = BrowserTestUtils.waitForNewTab(gBrowser); let waitForTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);

View File

@ -13,7 +13,7 @@ add_task(async function() {
}; };
info("testVerifyNewSignin"); info("testVerifyNewSignin");
setupMockAlertsService(); setupMockAlertsService();
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:mozilla"); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:mozilla");
await waitForDocLoadComplete(); await waitForDocLoadComplete();
let waitForTabPromise = BrowserTestUtils.waitForNewTab(gBrowser); let waitForTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);

View File

@ -22,7 +22,7 @@ add_task(async function test_network_markers_early_cancel() {
const tab = await BrowserTestUtils.openNewForegroundTab(options); const tab = await BrowserTestUtils.openNewForegroundTab(options);
const loadPromise = BrowserTestUtils.waitForDocLoadAndStopIt(url, tab); const loadPromise = BrowserTestUtils.waitForDocLoadAndStopIt(url, tab);
BrowserTestUtils.loadURI(tab.linkedBrowser, url); BrowserTestUtils.loadURIString(tab.linkedBrowser, url);
const contentPid = await SpecialPowers.spawn( const contentPid = await SpecialPowers.spawn(
tab.linkedBrowser, tab.linkedBrowser,
[], [],

View File

@ -20,7 +20,7 @@ add_task(async function test_network_markers() {
try { try {
const url = BASE_URL_HTTPS + "simple.html?cacheBust=" + Math.random(); const url = BASE_URL_HTTPS + "simple.html?cacheBust=" + Math.random();
const contentBrowser = win.gBrowser.selectedBrowser; const contentBrowser = win.gBrowser.selectedBrowser;
BrowserTestUtils.loadURI(contentBrowser, url); BrowserTestUtils.loadURIString(contentBrowser, url);
await BrowserTestUtils.browserLoaded(contentBrowser, false, url); await BrowserTestUtils.browserLoaded(contentBrowser, false, url);
const contentPid = await SpecialPowers.spawn( const contentPid = await SpecialPowers.spawn(
contentBrowser, contentBrowser,

View File

@ -29,7 +29,7 @@ add_task(async function test_profile_fission_no_private_browsing() {
try { try {
const url = BASE_URL_HTTPS + "single_frame.html"; const url = BASE_URL_HTTPS + "single_frame.html";
const contentBrowser = win.gBrowser.selectedBrowser; const contentBrowser = win.gBrowser.selectedBrowser;
BrowserTestUtils.loadURI(contentBrowser, url); BrowserTestUtils.loadURIString(contentBrowser, url);
await BrowserTestUtils.browserLoaded(contentBrowser, false, url); await BrowserTestUtils.browserLoaded(contentBrowser, false, url);
const parentPid = Services.appinfo.processID; const parentPid = Services.appinfo.processID;
@ -142,7 +142,7 @@ add_task(async function test_profile_fission_private_browsing() {
try { try {
const url = BASE_URL_HTTPS + "single_frame.html"; const url = BASE_URL_HTTPS + "single_frame.html";
const contentBrowser = win.gBrowser.selectedBrowser; const contentBrowser = win.gBrowser.selectedBrowser;
BrowserTestUtils.loadURI(contentBrowser, url); BrowserTestUtils.loadURIString(contentBrowser, url);
await BrowserTestUtils.browserLoaded(contentBrowser, false, url); await BrowserTestUtils.browserLoaded(contentBrowser, false, url);
const contentPid = await SpecialPowers.spawn(contentBrowser, [], () => { const contentPid = await SpecialPowers.spawn(contentBrowser, [], () => {

View File

@ -79,7 +79,7 @@ add_task(async function test_profile_private_browsing() {
try { try {
const url = BASE_URL_HTTPS + "single_frame.html"; const url = BASE_URL_HTTPS + "single_frame.html";
const contentBrowser = win.gBrowser.selectedBrowser; const contentBrowser = win.gBrowser.selectedBrowser;
BrowserTestUtils.loadURI(contentBrowser, url); BrowserTestUtils.loadURIString(contentBrowser, url);
await BrowserTestUtils.browserLoaded(contentBrowser, false, url); await BrowserTestUtils.browserLoaded(contentBrowser, false, url);
const contentPid = await SpecialPowers.spawn(contentBrowser, [], () => { const contentPid = await SpecialPowers.spawn(contentBrowser, [], () => {

View File

@ -46,7 +46,7 @@ async function waitForPdfJS(browser, url) {
null, null,
true true
); );
BrowserTestUtils.loadURI(browser, url); BrowserTestUtils.loadURIString(browser, url);
return loadPromise; return loadPromise;
} }
@ -179,7 +179,7 @@ add_task(async function test_check_open_with_internal_handler() {
let subdialogPromise = BrowserTestUtils.domWindowOpenedAndLoaded(); let subdialogPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
// Current tab has file: URI and TEST_PATH is http uri, so uri will be different // Current tab has file: URI and TEST_PATH is http uri, so uri will be different
BrowserTestUtils.loadURI(newTab.linkedBrowser, TEST_PATH + file); BrowserTestUtils.loadURIString(newTab.linkedBrowser, TEST_PATH + file);
let subDialogWindow = await subdialogPromise; let subDialogWindow = await subdialogPromise;
let subDoc = subDialogWindow.document; let subDoc = subDialogWindow.document;

View File

@ -157,7 +157,7 @@ async function createDownloadTest(
let downloadFinishedPromise = skipDownload let downloadFinishedPromise = skipDownload
? null ? null
: promiseDownloadFinished(downloadList); : promiseDownloadFinished(downloadList);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, file.url); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, file.url);
if (action.id === Ci.nsIHandlerInfo.alwaysAsk) { if (action.id === Ci.nsIHandlerInfo.alwaysAsk) {
info("Check Always Ask dialog."); info("Check Always Ask dialog.");
let dialogWindow = await dialogWindowPromise; let dialogWindow = await dialogWindowPromise;
@ -249,7 +249,7 @@ add_task(async function test_download_preferred_action() {
Services.prefs.clearUserPref( Services.prefs.clearUserPref(
"browser.download.always_ask_before_handling_new_types" "browser.download.always_ask_before_handling_new_types"
); );
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:home"); BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:home");
for (const index in FILE_TYPES_TO_TEST) { for (const index in FILE_TYPES_TO_TEST) {
let file = FILE_TYPES_TO_TEST[index]; let file = FILE_TYPES_TO_TEST[index];
let mimeSettings = gMIMEService.getFromTypeAndExtension( let mimeSettings = gMIMEService.getFromTypeAndExtension(

View File

@ -26,7 +26,7 @@ add_task(async function test_open_without_user_interaction() {
true true
); );
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
tab.linkedBrowser, tab.linkedBrowser,
TEST_PATH + "file_external_protocol_iframe.html" TEST_PATH + "file_external_protocol_iframe.html"
); );

View File

@ -14,7 +14,7 @@ add_task(async function() {
// Load a page registering a protocol handler. // Load a page registering a protocol handler.
let browser = gBrowser.selectedBrowser; let browser = gBrowser.selectedBrowser;
BrowserTestUtils.loadURI(browser, testURL); BrowserTestUtils.loadURIString(browser, testURL);
await BrowserTestUtils.browserLoaded(browser, false, testURL); await BrowserTestUtils.browserLoaded(browser, false, testURL);
// Register the protocol handler by clicking the notificationbar button. // Register the protocol handler by clicking the notificationbar button.

View File

@ -95,7 +95,7 @@ add_task(async function test_closed_by_tab_navigation() {
}); });
info("Navigating tab to a different but same origin page."); info("Navigating tab to a different but same origin page.");
BrowserTestUtils.loadURI(tab.linkedBrowser, TEST_PATH); BrowserTestUtils.loadURIString(tab.linkedBrowser, TEST_PATH);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, TEST_PATH); await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, TEST_PATH);
ok(dialog._frame.contentWindow, "Dialog should stay open."); ok(dialog._frame.contentWindow, "Dialog should stay open.");
@ -111,7 +111,7 @@ add_task(async function test_closed_by_tab_navigation() {
info("Now navigate to a cross-origin page."); info("Now navigate to a cross-origin page.");
const CROSS_ORIGIN_TEST_PATH = TEST_PATH.replace(".com", ".org"); const CROSS_ORIGIN_TEST_PATH = TEST_PATH.replace(".com", ".org");
BrowserTestUtils.loadURI(tab.linkedBrowser, CROSS_ORIGIN_TEST_PATH); BrowserTestUtils.loadURIString(tab.linkedBrowser, CROSS_ORIGIN_TEST_PATH);
let loadPromise = BrowserTestUtils.browserLoaded( let loadPromise = BrowserTestUtils.browserLoaded(
tab.linkedBrowser, tab.linkedBrowser,
false, false,

View File

@ -131,7 +131,7 @@ function useServerRedirect(serverRedirect) {
ROOT_PATH + ROOT_PATH +
"redirect_helper.sjs?" + "redirect_helper.sjs?" +
params.toString(); params.toString();
BrowserTestUtils.loadURI(browser, uri); BrowserTestUtils.loadURIString(browser, uri);
}; };
} }
@ -1299,7 +1299,7 @@ add_task(async function test_redirect_principal_js() {
ROOT_PATH + ROOT_PATH +
"script_redirect.html?" + "script_redirect.html?" +
params.toString(); params.toString();
BrowserTestUtils.loadURI(browser, uri); BrowserTestUtils.loadURIString(browser, uri);
}, },
permDialogOptions: { permDialogOptions: {
checkboxOrigin: ORIGIN1, checkboxOrigin: ORIGIN1,

View File

@ -59,7 +59,7 @@ add_task(async function test_helperapp() {
let askedUserPromise = waitForProtocolAppChooserDialog(browser, true); let askedUserPromise = waitForProtocolAppChooserDialog(browser, true);
BrowserTestUtils.loadURI(browser, kProt + ":test"); BrowserTestUtils.loadURIString(browser, kProt + ":test");
let dialog = await Promise.race([ let dialog = await Promise.race([
wrongThingHappenedPromise, wrongThingHappenedPromise,
askedUserPromise, askedUserPromise,

View File

@ -9,7 +9,7 @@ add_task(async function() {
// Load a page registering a protocol handler. // Load a page registering a protocol handler.
let browser = gBrowser.selectedBrowser; let browser = gBrowser.selectedBrowser;
BrowserTestUtils.loadURI(browser, testURL); BrowserTestUtils.loadURIString(browser, testURL);
await BrowserTestUtils.browserLoaded(browser, false, testURL); await BrowserTestUtils.browserLoaded(browser, false, testURL);
// Register the protocol handler by clicking the notificationbar button. // Register the protocol handler by clicking the notificationbar button.

View File

@ -49,7 +49,7 @@ add_task(async () => {
true /* waitForLoad */ true /* waitForLoad */
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, secondPage); BrowserTestUtils.loadURIString(tab.linkedBrowser, secondPage);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage); await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage);
// Make sure we can go back to the previous page. // Make sure we can go back to the previous page.
@ -176,7 +176,7 @@ add_task(async () => {
true /* waitForLoad */ true /* waitForLoad */
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, secondPage); BrowserTestUtils.loadURIString(tab.linkedBrowser, secondPage);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage); await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage);
// Make sure we can go back to the previous page. // Make sure we can go back to the previous page.
@ -279,7 +279,7 @@ add_task(async () => {
true /* waitForLoad */ true /* waitForLoad */
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, secondPage); BrowserTestUtils.loadURIString(tab.linkedBrowser, secondPage);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage); await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage);
// Make sure we can go back to the previous page. // Make sure we can go back to the previous page.
@ -378,7 +378,7 @@ add_task(async () => {
true /* waitForLoad */ true /* waitForLoad */
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, secondPage); BrowserTestUtils.loadURIString(tab.linkedBrowser, secondPage);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage); await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage);
// Make sure we can go back to the previous page. // Make sure we can go back to the previous page.
@ -463,7 +463,7 @@ add_task(async () => {
true /* waitForLoad */ true /* waitForLoad */
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, secondPage); BrowserTestUtils.loadURIString(tab.linkedBrowser, secondPage);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage); await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage);
// Make sure we can go back to the previous page. // Make sure we can go back to the previous page.
@ -562,7 +562,7 @@ add_task(async () => {
true /* waitForLoad */ true /* waitForLoad */
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, secondPage); BrowserTestUtils.loadURIString(tab.linkedBrowser, secondPage);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage); await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage);
// Make sure we can go back to the previous page. // Make sure we can go back to the previous page.
@ -635,7 +635,7 @@ add_task(async () => {
true /* waitForLoad */ true /* waitForLoad */
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, secondPage); BrowserTestUtils.loadURIString(tab.linkedBrowser, secondPage);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage); await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage);
// Make sure we can go back to the previous page. // Make sure we can go back to the previous page.
@ -704,7 +704,7 @@ add_task(async () => {
"chrome://mochitests/content/", "chrome://mochitests/content/",
"http://mochi.test:8888/" "http://mochi.test:8888/"
); );
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
tab.linkedBrowser, tab.linkedBrowser,
URL_ROOT + "helper_swipe_gesture.html" URL_ROOT + "helper_swipe_gesture.html"
); );
@ -788,7 +788,7 @@ add_task(async () => {
"chrome://mochitests/content/", "chrome://mochitests/content/",
"http://mochi.test:8888/" "http://mochi.test:8888/"
); );
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
tab.linkedBrowser, tab.linkedBrowser,
URL_ROOT + "helper_swipe_gesture.html" URL_ROOT + "helper_swipe_gesture.html"
); );
@ -853,7 +853,7 @@ add_task(async () => {
"chrome://mochitests/content/", "chrome://mochitests/content/",
"http://mochi.test:8888/" "http://mochi.test:8888/"
); );
BrowserTestUtils.loadURI( BrowserTestUtils.loadURIString(
tab.linkedBrowser, tab.linkedBrowser,
URL_ROOT + "helper_swipe_gesture.html" URL_ROOT + "helper_swipe_gesture.html"
); );
@ -918,7 +918,7 @@ add_task(async () => {
true /* waitForLoad */ true /* waitForLoad */
); );
BrowserTestUtils.loadURI(tab.linkedBrowser, secondPage); BrowserTestUtils.loadURIString(tab.linkedBrowser, secondPage);
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage); await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, secondPage);
// Make sure we can go back to the previous page. // Make sure we can go back to the previous page.