Skip to content

Commit

Permalink
Bug 1810995 - update BrowserTestUtils.loadURI consumers to use loadUR…
Browse files Browse the repository at this point in the history
…IString (automated) - other directories - r=Standard8,webdriver-reviewers,whimboo

Differential Revision: https://phabricator.services.mozilla.com/D167154
  • Loading branch information
gijsk committed Jan 19, 2023
1 parent 1851a45 commit 8f546a1
Show file tree
Hide file tree
Showing 32 changed files with 56 additions and 56 deletions.
10 changes: 5 additions & 5 deletions accessible/tests/browser/events/browser_test_docload.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function runTests(browser, accDoc) {
],
});

BrowserTestUtils.loadURI(
BrowserTestUtils.loadURIString(
browser,
`data:text/html;charset=utf-8,
<html><body id="body2">
Expand All @@ -59,7 +59,7 @@ async function runTests(browser, accDoc) {
[EVENT_REORDER, getAccessible(browser)],
]);

BrowserTestUtils.loadURI(browser, "about:about");
BrowserTestUtils.loadURIString(browser, "about:about");

await onLoadEvents;

Expand All @@ -79,7 +79,7 @@ async function runTests(browser, accDoc) {
[EVENT_REORDER, getAccessible(browser)],
]);

BrowserTestUtils.loadURI(browser, "about:mozilla");
BrowserTestUtils.loadURIString(browser, "about:mozilla");

await onLoadEvents;

Expand All @@ -101,7 +101,7 @@ async function runTests(browser, accDoc) {
]);

// 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;

Expand All @@ -111,7 +111,7 @@ async function runTests(browser, accDoc) {
[EVENT_REORDER, getAccessible(browser)],
]);

BrowserTestUtils.loadURI(browser, "https://nocert.example.com:443/");
BrowserTestUtils.loadURIString(browser, "https://nocert.example.com:443/");

await onLoadEvents;
}
Expand Down
2 changes: 1 addition & 1 deletion accessible/tests/browser/events/browser_test_textcaret.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function caretMoveChecker(target, caretOffset) {
async function checkURLBarCaretEvents() {
const kURL = "about:mozilla";
let newWin = await BrowserTestUtils.openNewBrowserWindow();
BrowserTestUtils.loadURI(newWin.gBrowser.selectedBrowser, kURL);
BrowserTestUtils.loadURIString(newWin.gBrowser.selectedBrowser, kURL);
newWin.gBrowser.selectedBrowser.focus();

await waitForEvent(EVENT_DOCUMENT_LOAD_COMPLETE, event => {
Expand Down
2 changes: 1 addition & 1 deletion netwerk/test/browser/browser_bug1629307.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ add_task(async function() {
})
.catch(function() {});

BrowserTestUtils.loadURI(gBrowser.selectedBrowser, URL);
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, URL);

// wait until the page and its iframe page is loaded
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, true, URL);
Expand Down
2 changes: 1 addition & 1 deletion netwerk/test/browser/browser_post_auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ add_task(async function() {
true,
`${FOLDER}post.html`
);
BrowserTestUtils.loadURI(tab.linkedBrowser, `${FOLDER}post.html`);
BrowserTestUtils.loadURIString(tab.linkedBrowser, `${FOLDER}post.html`);
await browserLoadedPromise;

let finalLoadPromise = BrowserTestUtils.browserLoaded(
Expand Down
2 changes: 1 addition & 1 deletion netwerk/test/browser/browser_post_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ add_task(async function() {
true,
actionURI
);
BrowserTestUtils.loadURI(tab.linkedBrowser, postURI);
BrowserTestUtils.loadURIString(tab.linkedBrowser, postURI);
await browserLoadedPromise;

var actionFileContentAfter = await IOUtils.readUTF8(actionPath);
Expand Down
2 changes: 1 addition & 1 deletion remote/cdp/test/browser/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ async function loadURL(url, expectedURL = undefined) {
const browser = gBrowser.selectedTab.linkedBrowser;
const loaded = BrowserTestUtils.browserLoaded(browser, true, expectedURL);

BrowserTestUtils.loadURI(browser, url);
BrowserTestUtils.loadURIString(browser, url);
await loaded;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ async function assertOfflineNavigationFails() {
const browser = gBrowser.selectedTab.linkedBrowser;
let netErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);

BrowserTestUtils.loadURI(browser, pageEmptyURL);
BrowserTestUtils.loadURIString(browser, pageEmptyURL);
await netErrorLoaded;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@ function navigateToAnchor(baseUrl, hash) {
gBrowser,
url
);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
return onLocationChange;
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ add_task(async function testDefault({ Security }) {
for (const url of BAD_CERTS) {
info(`Navigating to ${url}`);
const loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
await loaded;

is(
Expand All @@ -94,7 +94,7 @@ add_task(async function testIgnore({ client }) {

for (const url of BAD_CERTS) {
info(`Navigating to ${url}`);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);

is(
Expand All @@ -114,7 +114,7 @@ add_task(async function testUnignore({ client }) {
for (const url of BAD_CERTS) {
info(`Navigating to ${url}`);
const loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
await loaded;

is(
Expand All @@ -135,7 +135,7 @@ add_task(async function testToggle({ client }) {
await Security.setIgnoreCertificateErrors({ ignore: true });

info(`Navigating to ${UNTRUSTED} having set the override`);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, UNTRUSTED);
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, UNTRUSTED);
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);

is(
Expand All @@ -150,7 +150,7 @@ add_task(async function testToggle({ client }) {

info(`Navigating to ${UNTRUSTED} having unset the override`);
loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, UNTRUSTED);
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, UNTRUSTED);
await loaded;

is(
Expand Down
2 changes: 1 addition & 1 deletion remote/shared/listeners/test/browser/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function doGC() {
*/
async function loadURL(browser, url) {
const loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, url);
BrowserTestUtils.loadURIString(browser, url);
return loaded;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ add_task(async function test_sessionDataRootOnlyModule() {
const rootMessageHandler = createRootMessageHandler(sessionId);
ok(rootMessageHandler, "Valid ROOT MessageHandler created");

await BrowserTestUtils.loadURI(
await BrowserTestUtils.loadURIString(
gBrowser,
"https://example.com/document-builder.sjs?html=tab"
);
Expand Down
2 changes: 1 addition & 1 deletion remote/shared/messagehandler/test/browser/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function createRootMessageHandler(sessionId) {
*/
async function loadURL(browser, url) {
const loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, url);
BrowserTestUtils.loadURIString(browser, url);
return loaded;
}

Expand Down
4 changes: 2 additions & 2 deletions remote/shared/test/browser/browser_TabManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ add_task(async function test_getBrowsingContextById() {

info(`Navigate to ${TEST_URL}`);
const loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, TEST_URL);
BrowserTestUtils.loadURIString(browser, TEST_URL);
await loaded;

const contexts = browser.browsingContext.getAllBrowsingContextsInSubtree();
Expand Down Expand Up @@ -135,7 +135,7 @@ add_task(async function test_getTabForBrowsingContext() {

info(`Navigate to ${TEST_URL}`);
const loaded = BrowserTestUtils.browserLoaded(browser);
BrowserTestUtils.loadURI(browser, TEST_URL);
BrowserTestUtils.loadURIString(browser, TEST_URL);
await loaded;

const contexts = browser.browsingContext.getAllBrowsingContextsInSubtree();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function test() {
certOverrideService.clearValidityOverride(INVALID_CERT_DOMAIN, -1, {});
});

BrowserTestUtils.loadURI(gBrowser, INVALID_CERT_LOCATION);
BrowserTestUtils.loadURIString(gBrowser, INVALID_CERT_LOCATION);
let loaded = await BrowserTestUtils.browserLoaded(
gBrowser,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function test() {
}
);

BrowserTestUtils.loadURI(aWindow.gBrowser.selectedBrowser, testURI);
BrowserTestUtils.loadURIString(aWindow.gBrowser.selectedBrowser, testURI);
}

function testOnWindow(aOptions, aCallback) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function testHelper(connectURL, expectedURL) {
set: [["security.default_personal_cert", "Ask Every Time"]],
});

BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, connectURL);
BrowserTestUtils.loadURIString(win.gBrowser.selectedBrowser, connectURL);

await BrowserTestUtils.browserLoaded(
win.gBrowser.selectedBrowser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async function testHelper(

let win = await BrowserTestUtils.openNewBrowserWindow(options);

BrowserTestUtils.loadURI(
BrowserTestUtils.loadURIString(
win.gBrowser.selectedBrowser,
"https://requireclientcert.example.com:443"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ add_setup(async function() {

async function testDeviceConnected(deviceName) {
info("testDeviceConnected with deviceName=" + deviceName);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:mozilla");
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:mozilla");
await waitForDocLoadComplete();

let waitForTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
Expand Down
2 changes: 1 addition & 1 deletion services/fxaccounts/tests/browser/browser_verify_login.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_task(async function() {
};
info("testVerifyNewSignin");
setupMockAlertsService();
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:mozilla");
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:mozilla");
await waitForDocLoadComplete();

let waitForTabPromise = BrowserTestUtils.waitForNewTab(gBrowser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ add_task(async function test_network_markers_early_cancel() {

const tab = await BrowserTestUtils.openNewForegroundTab(options);
const loadPromise = BrowserTestUtils.waitForDocLoadAndStopIt(url, tab);
BrowserTestUtils.loadURI(tab.linkedBrowser, url);
BrowserTestUtils.loadURIString(tab.linkedBrowser, url);
const contentPid = await SpecialPowers.spawn(
tab.linkedBrowser,
[],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_task(async function test_network_markers() {
try {
const url = BASE_URL_HTTPS + "simple.html?cacheBust=" + Math.random();
const contentBrowser = win.gBrowser.selectedBrowser;
BrowserTestUtils.loadURI(contentBrowser, url);
BrowserTestUtils.loadURIString(contentBrowser, url);
await BrowserTestUtils.browserLoaded(contentBrowser, false, url);
const contentPid = await SpecialPowers.spawn(
contentBrowser,
Expand Down
4 changes: 2 additions & 2 deletions tools/profiler/tests/browser/browser_test_profile_fission.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ add_task(async function test_profile_fission_no_private_browsing() {
try {
const url = BASE_URL_HTTPS + "single_frame.html";
const contentBrowser = win.gBrowser.selectedBrowser;
BrowserTestUtils.loadURI(contentBrowser, url);
BrowserTestUtils.loadURIString(contentBrowser, url);
await BrowserTestUtils.browserLoaded(contentBrowser, false, url);

const parentPid = Services.appinfo.processID;
Expand Down Expand Up @@ -142,7 +142,7 @@ add_task(async function test_profile_fission_private_browsing() {
try {
const url = BASE_URL_HTTPS + "single_frame.html";
const contentBrowser = win.gBrowser.selectedBrowser;
BrowserTestUtils.loadURI(contentBrowser, url);
BrowserTestUtils.loadURIString(contentBrowser, url);
await BrowserTestUtils.browserLoaded(contentBrowser, false, url);

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

const contentPid = await SpecialPowers.spawn(contentBrowser, [], () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function waitForPdfJS(browser, url) {
null,
true
);
BrowserTestUtils.loadURI(browser, url);
BrowserTestUtils.loadURIString(browser, url);
return loadPromise;
}

Expand Down Expand Up @@ -179,7 +179,7 @@ add_task(async function test_check_open_with_internal_handler() {

let subdialogPromise = BrowserTestUtils.domWindowOpenedAndLoaded();
// 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 subDoc = subDialogWindow.document;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ async function createDownloadTest(
let downloadFinishedPromise = skipDownload
? null
: promiseDownloadFinished(downloadList);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, file.url);
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, file.url);
if (action.id === Ci.nsIHandlerInfo.alwaysAsk) {
info("Check Always Ask dialog.");
let dialogWindow = await dialogWindowPromise;
Expand Down Expand Up @@ -249,7 +249,7 @@ add_task(async function test_download_preferred_action() {
Services.prefs.clearUserPref(
"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) {
let file = FILE_TYPES_TO_TEST[index];
let mimeSettings = gMIMEService.getFromTypeAndExtension(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ add_task(async function test_open_without_user_interaction() {
true
);

BrowserTestUtils.loadURI(
BrowserTestUtils.loadURIString(
tab.linkedBrowser,
TEST_PATH + "file_external_protocol_iframe.html"
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ add_task(async function() {

// Load a page registering a protocol handler.
let browser = gBrowser.selectedBrowser;
BrowserTestUtils.loadURI(browser, testURL);
BrowserTestUtils.loadURIString(browser, testURL);
await BrowserTestUtils.browserLoaded(browser, false, testURL);

// Register the protocol handler by clicking the notificationbar button.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ add_task(async function test_closed_by_tab_navigation() {
});

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);
ok(dialog._frame.contentWindow, "Dialog should stay open.");

Expand All @@ -111,7 +111,7 @@ add_task(async function test_closed_by_tab_navigation() {

info("Now navigate to a cross-origin page.");
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(
tab.linkedBrowser,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function useServerRedirect(serverRedirect) {
ROOT_PATH +
"redirect_helper.sjs?" +
params.toString();
BrowserTestUtils.loadURI(browser, uri);
BrowserTestUtils.loadURIString(browser, uri);
};
}

Expand Down Expand Up @@ -1299,7 +1299,7 @@ add_task(async function test_redirect_principal_js() {
ROOT_PATH +
"script_redirect.html?" +
params.toString();
BrowserTestUtils.loadURI(browser, uri);
BrowserTestUtils.loadURIString(browser, uri);
},
permDialogOptions: {
checkboxOrigin: ORIGIN1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ add_task(async function test_helperapp() {

let askedUserPromise = waitForProtocolAppChooserDialog(browser, true);

BrowserTestUtils.loadURI(browser, kProt + ":test");
BrowserTestUtils.loadURIString(browser, kProt + ":test");
let dialog = await Promise.race([
wrongThingHappenedPromise,
askedUserPromise,
Expand Down
Loading

0 comments on commit 8f546a1

Please sign in to comment.