Bug 1810995 - update BrowserTestUtils.loadURI consumers to use loadURIString (automated) - browser - r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D167153
This commit is contained in:
@@ -84,7 +84,7 @@ add_task(async function checkReturnToPreviousPage() {
|
||||
tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, GOOD_PAGE);
|
||||
browser = tab.linkedBrowser;
|
||||
|
||||
BrowserTestUtils.loadURI(browser, GOOD_PAGE_2);
|
||||
BrowserTestUtils.loadURIString(browser, GOOD_PAGE_2);
|
||||
await BrowserTestUtils.browserLoaded(browser, false, GOOD_PAGE_2);
|
||||
await injectErrorPageFrame(tab, BAD_CERT);
|
||||
} else {
|
||||
@@ -93,7 +93,7 @@ add_task(async function checkReturnToPreviousPage() {
|
||||
|
||||
info("Loading and waiting for the cert error");
|
||||
let certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
|
||||
BrowserTestUtils.loadURI(browser, BAD_CERT);
|
||||
BrowserTestUtils.loadURIString(browser, BAD_CERT);
|
||||
await certErrorLoaded;
|
||||
}
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ add_task(async function onlyAllow3DESWithDeprecatedTLS() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{ gBrowser, url: "about:blank" },
|
||||
async browser => {
|
||||
BrowserTestUtils.loadURI(browser, TRIPLEDES_PAGE);
|
||||
BrowserTestUtils.loadURIString(browser, TRIPLEDES_PAGE);
|
||||
await BrowserTestUtils.waitForErrorPage(browser);
|
||||
}
|
||||
);
|
||||
@@ -222,7 +222,7 @@ add_task(async function onlyAllow3DESWithDeprecatedTLS() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{ gBrowser, url: "about:blank" },
|
||||
async browser => {
|
||||
BrowserTestUtils.loadURI(browser, TRIPLEDES_PAGE);
|
||||
BrowserTestUtils.loadURIString(browser, TRIPLEDES_PAGE);
|
||||
await BrowserTestUtils.browserLoaded(browser, false, TRIPLEDES_PAGE);
|
||||
}
|
||||
);
|
||||
@@ -235,7 +235,7 @@ add_task(async function onlyAllow3DESWithDeprecatedTLS() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{ gBrowser, url: "about:blank" },
|
||||
async browser => {
|
||||
BrowserTestUtils.loadURI(browser, TRIPLEDES_PAGE);
|
||||
BrowserTestUtils.loadURIString(browser, TRIPLEDES_PAGE);
|
||||
await BrowserTestUtils.waitForErrorPage(browser);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -72,7 +72,7 @@ async function setupPage(htmlPageName, blockedPage) {
|
||||
true
|
||||
);
|
||||
|
||||
BrowserTestUtils.loadURI(browser, iFramePage);
|
||||
BrowserTestUtils.loadURIString(browser, iFramePage);
|
||||
await browserLoaded;
|
||||
info("The error page has loaded!");
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ async function setupPage(htmlPageName, blockedPage) {
|
||||
true
|
||||
);
|
||||
|
||||
BrowserTestUtils.loadURI(browser, iFramePage);
|
||||
BrowserTestUtils.loadURIString(browser, iFramePage);
|
||||
await browserLoaded;
|
||||
info("The error page has loaded!");
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ add_task(async function bookmarks_toolbar_shown_on_newtab() {
|
||||
ok(isBookmarksToolbarVisible(), "Toolbar should be visible on newtab");
|
||||
|
||||
// 2: Test that the toolbar is hidden when the browser is navigated away from newtab
|
||||
BrowserTestUtils.loadURI(newtab.linkedBrowser, "https://example.com");
|
||||
BrowserTestUtils.loadURIString(newtab.linkedBrowser, "https://example.com");
|
||||
await BrowserTestUtils.browserLoaded(newtab.linkedBrowser);
|
||||
await waitForBookmarksToolbarVisibility({
|
||||
visible: false,
|
||||
@@ -31,7 +31,7 @@ add_task(async function bookmarks_toolbar_shown_on_newtab() {
|
||||
);
|
||||
|
||||
// 3: Re-load about:newtab in the browser for the following tests and confirm toolbar reappears
|
||||
BrowserTestUtils.loadURI(newtab.linkedBrowser, "about:newtab");
|
||||
BrowserTestUtils.loadURIString(newtab.linkedBrowser, "about:newtab");
|
||||
await BrowserTestUtils.browserLoaded(newtab.linkedBrowser);
|
||||
await waitForBookmarksToolbarVisibility({
|
||||
visible: true,
|
||||
@@ -65,7 +65,7 @@ add_task(async function bookmarks_toolbar_shown_on_newtab() {
|
||||
});
|
||||
|
||||
// 7: Similar to #3 above, loading about:newtab in example should show toolbar
|
||||
BrowserTestUtils.loadURI(example.linkedBrowser, "about:newtab");
|
||||
BrowserTestUtils.loadURIString(example.linkedBrowser, "about:newtab");
|
||||
await BrowserTestUtils.browserLoaded(example.linkedBrowser);
|
||||
await waitForBookmarksToolbarVisibility({
|
||||
visible: true,
|
||||
@@ -88,7 +88,7 @@ add_task(async function bookmarks_toolbar_shown_on_newtab() {
|
||||
await BrowserTestUtils.switchTab(gBrowser, newtab);
|
||||
await waitForBookmarksToolbarVisibility({ visible: false });
|
||||
ok(!isBookmarksToolbarVisible(), "Toolbar should hide with custom newtab");
|
||||
BrowserTestUtils.loadURI(example.linkedBrowser, AboutNewTab.newTabURL);
|
||||
BrowserTestUtils.loadURIString(example.linkedBrowser, AboutNewTab.newTabURL);
|
||||
await BrowserTestUtils.browserLoaded(example.linkedBrowser);
|
||||
await BrowserTestUtils.switchTab(gBrowser, example);
|
||||
await waitForBookmarksToolbarVisibility({ visible: true });
|
||||
|
||||
@@ -57,7 +57,7 @@ add_task(async function checkDontShowStopFromLocalURI() {
|
||||
stopReloadContainerObserver.observe(stopReloadContainer, {
|
||||
attributeFilter: ["animate"],
|
||||
});
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, "about:mozilla");
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, "about:mozilla");
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
|
||||
Assert.ok(
|
||||
@@ -82,7 +82,7 @@ add_task(async function checkDontShowStopFromNonLocalURI() {
|
||||
stopReloadContainerObserver.observe(stopReloadContainer, {
|
||||
attributeFilter: ["animate"],
|
||||
});
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, "about:mozilla");
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, "about:mozilla");
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
|
||||
Assert.ok(
|
||||
@@ -132,7 +132,7 @@ add_task(async function checkAnimateStopOnTabAfterTabFinishesOpening() {
|
||||
return !gBrowser.tabAnimationsInProgress;
|
||||
});
|
||||
let animatePromise = getAnimatePromise(stopReloadContainer);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, "https://example.com");
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, "https://example.com");
|
||||
await animatePromise;
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
|
||||
@@ -158,7 +158,7 @@ add_task(async function checkDoShowStopFromLocalURI() {
|
||||
return !gBrowser.tabAnimationsInProgress;
|
||||
});
|
||||
let animatePromise = getAnimatePromise(stopReloadContainer);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, "https://example.com");
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, "https://example.com");
|
||||
await animatePromise;
|
||||
await waitForNoAnimation(stopReloadContainer);
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
|
||||
@@ -21,7 +21,7 @@ add_task(async function checkSwitchPageToOnlineMode() {
|
||||
await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
|
||||
let netErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
|
||||
|
||||
BrowserTestUtils.loadURI(browser, "http://example.com/");
|
||||
BrowserTestUtils.loadURIString(browser, "http://example.com/");
|
||||
await netErrorLoaded;
|
||||
|
||||
// Re-enable the proxy so example.com is resolved to localhost, rather than
|
||||
|
||||
@@ -141,7 +141,7 @@ function promiseTabLoadEvent(tab, url) {
|
||||
let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, handle);
|
||||
|
||||
if (url) {
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, url);
|
||||
}
|
||||
|
||||
return loaded;
|
||||
|
||||
@@ -19,7 +19,7 @@ let testcases = [
|
||||
false,
|
||||
CANONICAL_URL_REDIRECTED
|
||||
);
|
||||
BrowserTestUtils.loadURI(browser, CANONICAL_URL_REDIRECTED);
|
||||
BrowserTestUtils.loadURIString(browser, CANONICAL_URL_REDIRECTED);
|
||||
await loadPromise;
|
||||
await freePortal(true);
|
||||
ensurePortalTab(win);
|
||||
|
||||
@@ -20,7 +20,7 @@ async function rightClickOpenInNewTabAndReturnContent(selector) {
|
||||
false,
|
||||
RESOURCE_LINK
|
||||
);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, RESOURCE_LINK);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, RESOURCE_LINK);
|
||||
await loaded;
|
||||
|
||||
const generatedBlobURL = await ContentTask.spawn(
|
||||
@@ -97,7 +97,7 @@ async function openInNewTabAndReturnContent(selector) {
|
||||
false,
|
||||
RESOURCE_LINK
|
||||
);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, RESOURCE_LINK);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, RESOURCE_LINK);
|
||||
await loaded;
|
||||
|
||||
const generatedBlobURL = await ContentTask.spawn(
|
||||
|
||||
@@ -182,7 +182,7 @@ add_task(async function test_text_input_spellcheck_deadactor() {
|
||||
contextMenu.hidePopup();
|
||||
|
||||
// Now go back to the input testcase:
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, MAIN_URL);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, MAIN_URL);
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
gBrowser.selectedBrowser,
|
||||
false,
|
||||
@@ -203,7 +203,7 @@ add_task(async function test_text_input_spellcheck_deadactor() {
|
||||
wgp = gBrowser.selectedBrowser.browsingContext.currentWindowGlobal;
|
||||
|
||||
const NEW_URL = MAIN_URL.replace(".com", ".org");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, NEW_URL);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, NEW_URL);
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
gBrowser.selectedBrowser,
|
||||
false,
|
||||
@@ -226,7 +226,7 @@ add_task(async function test_text_input_spellcheck_deadactor() {
|
||||
// again; now the context menu stuff should be destroyed by the menu
|
||||
// hiding, nothing else.
|
||||
wgp = gBrowser.selectedBrowser.browsingContext.currentWindowGlobal;
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, NEW_URL);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, NEW_URL);
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
gBrowser.selectedBrowser,
|
||||
false,
|
||||
|
||||
@@ -61,7 +61,7 @@ add_task(async function test_back_forward_button_contextmenu_touch() {
|
||||
let notDisabled = TestUtils.waitForCondition(
|
||||
() => !backbutton.hasAttribute("disabled")
|
||||
);
|
||||
BrowserTestUtils.loadURI(browser, "http://example.org");
|
||||
BrowserTestUtils.loadURIString(browser, "http://example.org");
|
||||
await notDisabled;
|
||||
await openAndCheckContextMenu(contextMenu, backbutton);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ add_task(async function test() {
|
||||
const expectedIcon = testPath + "file_generic_favicon.ico";
|
||||
let faviconPromise = waitForLinkAvailable(tabBrowser);
|
||||
|
||||
BrowserTestUtils.loadURI(tabBrowser, URI);
|
||||
BrowserTestUtils.loadURIString(tabBrowser, URI);
|
||||
|
||||
let iconURI = await faviconPromise;
|
||||
is(iconURI, expectedIcon, "Correct icon before pushState.");
|
||||
|
||||
@@ -8,7 +8,7 @@ add_task(async function test() {
|
||||
const expectedIcon = testPath + "file_generic_favicon.ico";
|
||||
let faviconPromise = waitForLinkAvailable(tabBrowser);
|
||||
|
||||
BrowserTestUtils.loadURI(tabBrowser, URI);
|
||||
BrowserTestUtils.loadURIString(tabBrowser, URI);
|
||||
|
||||
let iconURI = await faviconPromise;
|
||||
is(iconURI, expectedIcon, "Correct icon before pushState.");
|
||||
|
||||
@@ -12,7 +12,7 @@ add_task(async () => {
|
||||
async browser => {
|
||||
let faviconPromise = waitForFaviconMessage(true, `${ROOT}accept.sjs`);
|
||||
|
||||
BrowserTestUtils.loadURI(browser, ROOT + "accept.html");
|
||||
BrowserTestUtils.loadURIString(browser, ROOT + "accept.html");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
try {
|
||||
|
||||
@@ -12,7 +12,7 @@ add_task(async () => {
|
||||
async browser => {
|
||||
let faviconPromise = waitForFaviconMessage(true, `${ROOT}auth_test.png`);
|
||||
|
||||
BrowserTestUtils.loadURI(browser, `${ROOT}auth_test.html`);
|
||||
BrowserTestUtils.loadURIString(browser, `${ROOT}auth_test.html`);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
await Assert.rejects(
|
||||
|
||||
@@ -25,7 +25,7 @@ add_task(async () => {
|
||||
ok(seenCookie, "Should have seen the cookie.");
|
||||
|
||||
faviconPromise = waitForLinkAvailable(browser);
|
||||
BrowserTestUtils.loadURI(browser, testPath);
|
||||
BrowserTestUtils.loadURIString(browser, testPath);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
await faviconPromise;
|
||||
cookies = Services.cookies.getCookiesFromHost(
|
||||
|
||||
@@ -14,7 +14,7 @@ add_task(async function() {
|
||||
TEST_ROOT + "file_bug970276_favicon1.ico"
|
||||
);
|
||||
|
||||
BrowserTestUtils.loadURI(extraTab.linkedBrowser, TEST_URL);
|
||||
BrowserTestUtils.loadURIString(extraTab.linkedBrowser, TEST_URL);
|
||||
await BrowserTestUtils.browserLoaded(extraTab.linkedBrowser);
|
||||
await haveChanged;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ add_task(async function() {
|
||||
let expectedFavicon = TEST_ROOT + "file_generic_favicon.ico";
|
||||
let faviconPromise = waitForFavicon(extraTab.linkedBrowser, expectedFavicon);
|
||||
|
||||
BrowserTestUtils.loadURI(extraTab.linkedBrowser, TEST_URL);
|
||||
BrowserTestUtils.loadURIString(extraTab.linkedBrowser, TEST_URL);
|
||||
await BrowserTestUtils.browserLoaded(extraTab.linkedBrowser);
|
||||
|
||||
await faviconPromise;
|
||||
|
||||
@@ -32,7 +32,7 @@ function run_test(url, shouldHaveCookies, description) {
|
||||
async browser => {
|
||||
const faviconPromise = waitForFaviconMessage(true, FAVICON_URL);
|
||||
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
await faviconPromise;
|
||||
|
||||
@@ -27,7 +27,7 @@ function run_test(root, shouldSucceed, description) {
|
||||
async browser => {
|
||||
const faviconPromise = waitForFaviconMessage(true, FAVICON_URL);
|
||||
|
||||
BrowserTestUtils.loadURI(browser, `${root}crossorigin.html`);
|
||||
BrowserTestUtils.loadURIString(browser, `${root}crossorigin.html`);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
if (shouldSucceed) {
|
||||
|
||||
@@ -20,7 +20,7 @@ add_task(async function test_check_referrer_for_discovered_favicon() {
|
||||
}
|
||||
).then(([chan]) => chan.getRequestHeader("Referer"));
|
||||
|
||||
BrowserTestUtils.loadURI(browser, `${FOLDER}discovery.html`);
|
||||
BrowserTestUtils.loadURIString(browser, `${FOLDER}discovery.html`);
|
||||
|
||||
let referrer = await referrerPromise;
|
||||
is(
|
||||
@@ -45,7 +45,7 @@ add_task(
|
||||
}
|
||||
).then(([chan]) => chan.getRequestHeader("Referer"));
|
||||
|
||||
BrowserTestUtils.loadURI(
|
||||
BrowserTestUtils.loadURIString(
|
||||
browser,
|
||||
`${FOLDER}file_favicon_no_referrer.html`
|
||||
);
|
||||
|
||||
@@ -10,7 +10,10 @@ add_task(async () => {
|
||||
{ gBrowser, url: "about:blank" },
|
||||
async browser => {
|
||||
let faviconPromise = waitForLinkAvailable(browser);
|
||||
BrowserTestUtils.loadURI(browser, testPath + "file_invalid_href.html");
|
||||
BrowserTestUtils.loadURIString(
|
||||
browser,
|
||||
testPath + "file_invalid_href.html"
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
let iconURI = await faviconPromise;
|
||||
|
||||
@@ -13,13 +13,16 @@ add_task(async () => {
|
||||
const expectedIcon = testPath + "file_generic_favicon.ico";
|
||||
let faviconPromise = waitForLinkAvailable(browser);
|
||||
|
||||
BrowserTestUtils.loadURI(browser, testPath + "file_with_favicon.html");
|
||||
BrowserTestUtils.loadURIString(
|
||||
browser,
|
||||
testPath + "file_with_favicon.html"
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
let iconURI = await faviconPromise;
|
||||
is(iconURI, expectedIcon, "Got correct icon.");
|
||||
|
||||
BrowserTestUtils.loadURI(browser, testPath + "blank.html");
|
||||
BrowserTestUtils.loadURIString(browser, testPath + "blank.html");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
is(browser.mIconURL, null, "Should have blanked the icon.");
|
||||
|
||||
@@ -10,7 +10,7 @@ add_task(async () => {
|
||||
async browser => {
|
||||
let faviconPromise = waitForFaviconMessage(true, `${ROOT}large.png`);
|
||||
|
||||
BrowserTestUtils.loadURI(browser, ROOT + "large_favicon.html");
|
||||
BrowserTestUtils.loadURIString(browser, ROOT + "large_favicon.html");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
await Assert.rejects(
|
||||
|
||||
@@ -13,7 +13,7 @@ add_task(async () => {
|
||||
is(iconURI, expectedIcon, "Got correct initial icon.");
|
||||
|
||||
faviconPromise = waitForLinkAvailable(browser);
|
||||
BrowserTestUtils.loadURI(browser, testPath);
|
||||
BrowserTestUtils.loadURIString(browser, testPath);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
iconURI = await faviconPromise;
|
||||
is(iconURI, expectedIcon, "Got correct icon on second load.");
|
||||
|
||||
@@ -37,7 +37,7 @@ add_task(async () => {
|
||||
{ gBrowser, url: "about:blank" },
|
||||
async browser => {
|
||||
let tab = gBrowser.getTabForBrowser(browser);
|
||||
BrowserTestUtils.loadURI(
|
||||
BrowserTestUtils.loadURIString(
|
||||
browser,
|
||||
TEST_PATH + "file_with_slow_favicon.html"
|
||||
);
|
||||
@@ -145,7 +145,7 @@ add_task(async () => {
|
||||
gBrowser.pinTab(tab);
|
||||
|
||||
let bounds = tab.getBoundingClientRect();
|
||||
BrowserTestUtils.loadURI(
|
||||
BrowserTestUtils.loadURIString(
|
||||
browser,
|
||||
TEST_PATH + "file_with_slow_favicon.html"
|
||||
);
|
||||
|
||||
@@ -325,7 +325,7 @@ add_task(async function test_large_popup_in_small_window() {
|
||||
let browserLoadedPromise = BrowserTestUtils.browserLoaded(
|
||||
newWin.gBrowser.selectedBrowser
|
||||
);
|
||||
BrowserTestUtils.loadURI(newWin.gBrowser.selectedBrowser, pageUrl);
|
||||
BrowserTestUtils.loadURIString(newWin.gBrowser.selectedBrowser, pageUrl);
|
||||
await browserLoadedPromise;
|
||||
|
||||
newWin.gBrowser.selectedBrowser.focus();
|
||||
|
||||
@@ -14,7 +14,7 @@ add_task(async function test_identityPopupCausesFSExit() {
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:blank", async browser => {
|
||||
let loaded = BrowserTestUtils.browserLoaded(browser, false, url);
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
await loaded;
|
||||
|
||||
let identityPermissionBox = document.getElementById(
|
||||
|
||||
@@ -198,8 +198,8 @@ async function test() {
|
||||
BrowserTestUtils.browserStopped(gBackgroundBrowser, kBasePage),
|
||||
BrowserTestUtils.browserStopped(gForegroundBrowser, kBasePage),
|
||||
];
|
||||
BrowserTestUtils.loadURI(gBackgroundBrowser, kBasePage);
|
||||
BrowserTestUtils.loadURI(gForegroundBrowser, kBasePage);
|
||||
BrowserTestUtils.loadURIString(gBackgroundBrowser, kBasePage);
|
||||
BrowserTestUtils.loadURIString(gForegroundBrowser, kBasePage);
|
||||
await Promise.all(promises);
|
||||
// If we process switched, the tabbrowser may still be processing the state_stop
|
||||
// notification here because of how microtasks work. Ensure that that has
|
||||
@@ -214,7 +214,7 @@ function runTest(browser, url, next) {
|
||||
gAllNotificationsPos = 0;
|
||||
gNextTest = next;
|
||||
gTestBrowser = browser;
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
}
|
||||
|
||||
function startTest1() {
|
||||
|
||||
@@ -5,7 +5,7 @@ add_task(async function() {
|
||||
);
|
||||
const htmlContent =
|
||||
"data:text/html, <iframe src='data:text/html,text text'></iframe>";
|
||||
BrowserTestUtils.loadURI(gBrowser, htmlContent);
|
||||
BrowserTestUtils.loadURIString(gBrowser, htmlContent);
|
||||
await loadedPromise;
|
||||
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function(arg) {
|
||||
|
||||
@@ -6,7 +6,7 @@ add_task(async function() {
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
let promise = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
|
||||
BrowserTestUtils.loadURI(gBrowser, "https://nocert.example.com/");
|
||||
BrowserTestUtils.loadURIString(gBrowser, "https://nocert.example.com/");
|
||||
await promise;
|
||||
|
||||
await remote(() => {
|
||||
|
||||
@@ -13,7 +13,7 @@ const URIS = [
|
||||
add_task(async function() {
|
||||
for (let uri of URIS) {
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, uri);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, uri);
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
|
||||
let win = gBrowser.replaceTabWithWindow(tab);
|
||||
|
||||
@@ -3,7 +3,7 @@ function test() {
|
||||
gBrowser.addProgressListener(progressListener1);
|
||||
gBrowser.addProgressListener(progressListener2);
|
||||
gBrowser.addProgressListener(progressListener3);
|
||||
BrowserTestUtils.loadURI(gBrowser, "data:text/plain,bug519216");
|
||||
BrowserTestUtils.loadURIString(gBrowser, "data:text/plain,bug519216");
|
||||
}
|
||||
|
||||
var calledListener1 = false;
|
||||
|
||||
@@ -27,7 +27,7 @@ add_task(async function test_remove_bookmark_with_tag_via_edit_bookmark() {
|
||||
"the test url is bookmarked"
|
||||
);
|
||||
|
||||
BrowserTestUtils.loadURI(gBrowser, testURL);
|
||||
BrowserTestUtils.loadURIString(gBrowser, testURL);
|
||||
|
||||
await TestUtils.waitForCondition(
|
||||
() => BookmarkingUI.status == BookmarkingUI.STATUS_STARRED,
|
||||
|
||||
@@ -2,10 +2,16 @@ add_task(async function test() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
"data:text/plain;charset=utf-8,1",
|
||||
async function(browser) {
|
||||
BrowserTestUtils.loadURI(browser, "data:text/plain;charset=utf-8,2");
|
||||
BrowserTestUtils.loadURIString(
|
||||
browser,
|
||||
"data:text/plain;charset=utf-8,2"
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
BrowserTestUtils.loadURI(browser, "data:text/plain;charset=utf-8,3");
|
||||
BrowserTestUtils.loadURIString(
|
||||
browser,
|
||||
"data:text/plain;charset=utf-8,3"
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
await duplicate(0, "maintained the original index");
|
||||
|
||||
@@ -41,7 +41,7 @@ function test() {
|
||||
}
|
||||
});
|
||||
|
||||
BrowserTestUtils.loadURI(
|
||||
BrowserTestUtils.loadURIString(
|
||||
tab.linkedBrowser,
|
||||
"http://example.com/browser/browser/base/content/test/general/dummy_page.html"
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@ add_task(async function test_blank() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{ gBrowser, url: "about:blank" },
|
||||
async function(browser) {
|
||||
BrowserTestUtils.loadURI(browser, "http://example.com");
|
||||
BrowserTestUtils.loadURIString(browser, "http://example.com");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
ok(!gBrowser.canGoBack, "about:blank wasn't added to session history");
|
||||
}
|
||||
@@ -22,11 +22,11 @@ add_task(async function test_newtab() {
|
||||
async function(browser) {
|
||||
// Can't load it directly because that'll use a preloaded tab if present.
|
||||
let stopped = BrowserTestUtils.browserStopped(browser, "about:newtab");
|
||||
BrowserTestUtils.loadURI(browser, "about:newtab");
|
||||
BrowserTestUtils.loadURIString(browser, "about:newtab");
|
||||
await stopped;
|
||||
|
||||
stopped = BrowserTestUtils.browserStopped(browser, "http://example.com/");
|
||||
BrowserTestUtils.loadURI(browser, "http://example.com/");
|
||||
BrowserTestUtils.loadURIString(browser, "http://example.com/");
|
||||
await stopped;
|
||||
|
||||
// This makes sure the parent process has the most up-to-date notion
|
||||
|
||||
@@ -124,7 +124,7 @@ add_task(async function() {
|
||||
let loadedPromise = BrowserTestUtils.browserLoaded(
|
||||
gBrowser.selectedBrowser
|
||||
);
|
||||
BrowserTestUtils.loadURI(gBrowser, test.url);
|
||||
BrowserTestUtils.loadURIString(gBrowser, test.url);
|
||||
await loadedPromise;
|
||||
|
||||
info("Run subtest " + test.name);
|
||||
|
||||
@@ -122,7 +122,7 @@ add_task(async function() {
|
||||
false,
|
||||
testPage1
|
||||
);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPage1);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, testPage1);
|
||||
await page1Promise;
|
||||
|
||||
// When the urlbar is focused, pressing F6 should focus the root of the content page.
|
||||
|
||||
@@ -18,7 +18,7 @@ add_task(async function findbar_test() {
|
||||
false,
|
||||
url
|
||||
);
|
||||
BrowserTestUtils.loadURI(newTab.linkedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(newTab.linkedBrowser, url);
|
||||
await promise;
|
||||
|
||||
await gFindBarPromise;
|
||||
|
||||
@@ -36,7 +36,7 @@ add_task(async function test_menu() {
|
||||
false
|
||||
);
|
||||
let browser = tab.linkedBrowser;
|
||||
BrowserTestUtils.loadURI(browser, WEB_ROOT + "page_style_sample.html");
|
||||
BrowserTestUtils.loadURIString(browser, WEB_ROOT + "page_style_sample.html");
|
||||
await promiseStylesheetsLoaded(tab, kStyleSheetsInPageStyleSample);
|
||||
|
||||
let menuitems = fillPopupAndGetItems();
|
||||
|
||||
@@ -14,7 +14,7 @@ add_task(async function() {
|
||||
false
|
||||
);
|
||||
let browser = tab.linkedBrowser;
|
||||
BrowserTestUtils.loadURI(browser, PAGE);
|
||||
BrowserTestUtils.loadURIString(browser, PAGE);
|
||||
await promiseStylesheetsLoaded(tab, 18);
|
||||
|
||||
let menupopup = document.getElementById("pageStyleMenu").menupopup;
|
||||
|
||||
@@ -106,7 +106,7 @@ async function testRealRefresh(refreshPage, delay) {
|
||||
async function(browser) {
|
||||
await pushPrefs(["accessibility.blockautorefresh", true]);
|
||||
|
||||
BrowserTestUtils.loadURI(
|
||||
BrowserTestUtils.loadURIString(
|
||||
browser,
|
||||
refreshPage + "?p=" + TARGET_PAGE + "&d=" + delay
|
||||
);
|
||||
@@ -172,7 +172,10 @@ add_task(async function test_can_update_notification() {
|
||||
await pushPrefs(["accessibility.blockautorefresh", true]);
|
||||
|
||||
// First, attempt a redirect
|
||||
BrowserTestUtils.loadURI(browser, META_PAGE + "?d=0&p=" + TARGET_PAGE);
|
||||
BrowserTestUtils.loadURIString(
|
||||
browser,
|
||||
META_PAGE + "?d=0&p=" + TARGET_PAGE
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
// Once browserLoaded resolves, all nsIWebProgressListener callbacks
|
||||
|
||||
@@ -44,7 +44,7 @@ add_task(async function navigate() {
|
||||
isAppTab = await isBrowserAppTab(browser);
|
||||
ok(isAppTab, "Docshell should think it is an app tab");
|
||||
|
||||
BrowserTestUtils.loadURI(gBrowser, DUMMY);
|
||||
BrowserTestUtils.loadURIString(gBrowser, DUMMY);
|
||||
await BrowserTestUtils.browserStopped(gBrowser);
|
||||
isAppTab = await isBrowserAppTab(browser);
|
||||
ok(isAppTab, "Docshell should think it is an app tab");
|
||||
@@ -57,7 +57,7 @@ add_task(async function navigate() {
|
||||
isAppTab = await isBrowserAppTab(browser);
|
||||
ok(isAppTab, "Docshell should think it is an app tab");
|
||||
|
||||
BrowserTestUtils.loadURI(gBrowser, "about:robots");
|
||||
BrowserTestUtils.loadURIString(gBrowser, "about:robots");
|
||||
await BrowserTestUtils.browserStopped(gBrowser);
|
||||
isAppTab = await isBrowserAppTab(browser);
|
||||
ok(isAppTab, "Docshell should think it is an app tab");
|
||||
|
||||
@@ -15,7 +15,7 @@ function triggerSave(aWindow, aCallback) {
|
||||
// This page sets a cookie if and only if a cookie does not exist yet
|
||||
let testURI =
|
||||
"http://mochi.test:8888/browser/browser/base/content/test/general/bug792517-2.html";
|
||||
BrowserTestUtils.loadURI(testBrowser, testURI);
|
||||
BrowserTestUtils.loadURIString(testBrowser, testURI);
|
||||
BrowserTestUtils.browserLoaded(testBrowser, false, testURI).then(() => {
|
||||
waitForFocus(function() {
|
||||
info("register to handle popupshown");
|
||||
|
||||
@@ -44,7 +44,7 @@ function triggerSave(aWindow, aCallback) {
|
||||
windowObserver.setCallback(onUCTDialog);
|
||||
}
|
||||
|
||||
BrowserTestUtils.loadURI(testBrowser, testURI);
|
||||
BrowserTestUtils.loadURIString(testBrowser, testURI);
|
||||
|
||||
// Create the folder the link will be saved into.
|
||||
var destDir = createTemporarySaveDirectory();
|
||||
|
||||
@@ -12,7 +12,7 @@ add_task(async function() {
|
||||
var fileName;
|
||||
|
||||
let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
BrowserTestUtils.loadURI(
|
||||
BrowserTestUtils.loadURIString(
|
||||
gBrowser,
|
||||
"http://mochi.test:8888/browser/browser/base/content/test/general/web_video.html"
|
||||
);
|
||||
|
||||
@@ -80,6 +80,6 @@ function promiseTabLoadEvent(aTab, aURL, aFinalURL) {
|
||||
}
|
||||
|
||||
info("Wait for load tab event");
|
||||
BrowserTestUtils.loadURI(aTab.linkedBrowser, aURL);
|
||||
BrowserTestUtils.loadURIString(aTab.linkedBrowser, aURL);
|
||||
return BrowserTestUtils.browserLoaded(aTab.linkedBrowser, false, aFinalURL);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ add_task(async function() {
|
||||
}
|
||||
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, uri);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, uri);
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, uri);
|
||||
await TabStateFlusher.flush(tab.linkedBrowser);
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ var clickTest = async function(tab) {
|
||||
};
|
||||
|
||||
function loadURI(tab, url) {
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, url);
|
||||
return BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ function insertAndClickAnchor(browser) {
|
||||
* Promise that resolves when the browser is no longer remote.
|
||||
*/
|
||||
function prepareNonRemoteBrowser(aWindow, browser) {
|
||||
BrowserTestUtils.loadURI(browser, NON_REMOTE_PAGE);
|
||||
BrowserTestUtils.loadURIString(browser, NON_REMOTE_PAGE);
|
||||
return BrowserTestUtils.browserLoaded(browser);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ add_task(async function() {
|
||||
// Calls focus event on the TabContextMenu early in the test.
|
||||
testWindow.gBrowser.selectedTab.focus();
|
||||
|
||||
BrowserTestUtils.loadURI(
|
||||
BrowserTestUtils.loadURIString(
|
||||
testWindow.gBrowser,
|
||||
"data:text/html,<h1>A Page</h1>"
|
||||
);
|
||||
|
||||
@@ -47,7 +47,7 @@ add_task(async function unknownContentType_title_with_pref_enabled() {
|
||||
|
||||
is(gBrowser.contentTitle, "Test Page", "Should have the right title.");
|
||||
|
||||
BrowserTestUtils.loadURI(browser, unknown_url);
|
||||
BrowserTestUtils.loadURIString(browser, unknown_url);
|
||||
let win = await waitForNewWindow();
|
||||
is(
|
||||
win.location.href,
|
||||
@@ -72,7 +72,7 @@ add_task(async function unknownContentType_title_with_pref_disabled() {
|
||||
|
||||
is(gBrowser.contentTitle, "Test Page", "Should have the right title.");
|
||||
|
||||
BrowserTestUtils.loadURI(browser, unknown_url);
|
||||
BrowserTestUtils.loadURIString(browser, unknown_url);
|
||||
// If the pref is disabled, then the downloads panel should open right away
|
||||
// since there is no UCT window prompt to block it.
|
||||
let waitForPanelShown = BrowserTestUtils.waitForCondition(() => {
|
||||
|
||||
@@ -246,7 +246,7 @@ function promiseTabLoadEvent(tab, url) {
|
||||
let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, handle);
|
||||
|
||||
if (url) {
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, url);
|
||||
}
|
||||
|
||||
return loaded;
|
||||
@@ -337,7 +337,7 @@ function promiseOnBookmarkItemAdded(aExpectedURI) {
|
||||
|
||||
async function loadBadCertPage(url) {
|
||||
let loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
|
||||
await loaded;
|
||||
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
|
||||
|
||||
@@ -72,13 +72,19 @@ add_task(async () => {
|
||||
);
|
||||
});
|
||||
|
||||
BrowserTestUtils.loadURI(newWindow.gBrowser.selectedBrowser, "about:mozilla");
|
||||
BrowserTestUtils.loadURIString(
|
||||
newWindow.gBrowser.selectedBrowser,
|
||||
"about:mozilla"
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
newWindow.gBrowser.selectedBrowser,
|
||||
false,
|
||||
"about:mozilla"
|
||||
);
|
||||
BrowserTestUtils.loadURI(newWindow.gBrowser.selectedBrowser, "about:about");
|
||||
BrowserTestUtils.loadURIString(
|
||||
newWindow.gBrowser.selectedBrowser,
|
||||
"about:about"
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
newWindow.gBrowser.selectedBrowser,
|
||||
false,
|
||||
@@ -173,13 +179,19 @@ add_task(async () => {
|
||||
);
|
||||
});
|
||||
|
||||
BrowserTestUtils.loadURI(newWindow.gBrowser.selectedBrowser, "about:mozilla");
|
||||
BrowserTestUtils.loadURIString(
|
||||
newWindow.gBrowser.selectedBrowser,
|
||||
"about:mozilla"
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
newWindow.gBrowser.selectedBrowser,
|
||||
false,
|
||||
"about:mozilla"
|
||||
);
|
||||
BrowserTestUtils.loadURI(newWindow.gBrowser.selectedBrowser, "about:about");
|
||||
BrowserTestUtils.loadURIString(
|
||||
newWindow.gBrowser.selectedBrowser,
|
||||
"about:about"
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
newWindow.gBrowser.selectedBrowser,
|
||||
false,
|
||||
|
||||
@@ -141,7 +141,7 @@ add_task(async function testBackForwardButtonPress() {
|
||||
await BrowserTestUtils.withNewTab("https://example.com/1", async function(
|
||||
aBrowser
|
||||
) {
|
||||
BrowserTestUtils.loadURI(aBrowser, "https://example.com/2");
|
||||
BrowserTestUtils.loadURIString(aBrowser, "https://example.com/2");
|
||||
|
||||
await BrowserTestUtils.browserLoaded(aBrowser);
|
||||
let backButton = document.getElementById("back-button");
|
||||
|
||||
@@ -306,7 +306,7 @@ add_task(async function testArrowsDisabledButtons() {
|
||||
"ArrowLeft on Reload button when prior buttons disabled does nothing"
|
||||
);
|
||||
|
||||
BrowserTestUtils.loadURI(aBrowser, "https://example.com/2");
|
||||
BrowserTestUtils.loadURIString(aBrowser, "https://example.com/2");
|
||||
await BrowserTestUtils.browserLoaded(aBrowser);
|
||||
await waitUntilReloadEnabled();
|
||||
startFromUrlBar();
|
||||
|
||||
@@ -22,7 +22,10 @@ add_task(async function test() {
|
||||
let win = await BrowserTestUtils.openNewBrowserWindow();
|
||||
await SimpleTest.promiseFocus(win);
|
||||
Assert.greater(win.outerWidth, 700, "window is bigger than 700px");
|
||||
BrowserTestUtils.loadURI(win.gBrowser, "data:text/html,<h1>A Page</h1>");
|
||||
BrowserTestUtils.loadURIString(
|
||||
win.gBrowser,
|
||||
"data:text/html,<h1>A Page</h1>"
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser);
|
||||
|
||||
// The pageAction implementation enables the button at the next animation
|
||||
@@ -85,7 +88,7 @@ add_task(async function bookmark() {
|
||||
const url = "data:text/html,<h1>A Page</h1>";
|
||||
let win = await BrowserTestUtils.openNewBrowserWindow();
|
||||
await SimpleTest.promiseFocus(win);
|
||||
BrowserTestUtils.loadURI(win.gBrowser, url);
|
||||
BrowserTestUtils.loadURIString(win.gBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser);
|
||||
|
||||
// The pageAction implementation enables the button at the next animation
|
||||
|
||||
@@ -45,7 +45,7 @@ add_task(async function contextMenu_removeExtension_panel() {
|
||||
const url = "data:text/html,<h1>A Page</h1>";
|
||||
let win = await BrowserTestUtils.openNewBrowserWindow();
|
||||
await SimpleTest.promiseFocus(win);
|
||||
BrowserTestUtils.loadURI(win.gBrowser, url);
|
||||
BrowserTestUtils.loadURIString(win.gBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser);
|
||||
|
||||
info("Shrink the window if necessary, check the meatball menu is visible");
|
||||
@@ -273,7 +273,7 @@ add_task(async function contextMenu_removeExtension_disabled_in_panel() {
|
||||
const url = "data:text/html,<h1>A Page</h1>";
|
||||
let win = await BrowserTestUtils.openNewBrowserWindow();
|
||||
await SimpleTest.promiseFocus(win);
|
||||
BrowserTestUtils.loadURI(win.gBrowser, url);
|
||||
BrowserTestUtils.loadURIString(win.gBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser);
|
||||
|
||||
info("Shrink the window if necessary, check the meatball menu is visible");
|
||||
|
||||
@@ -70,7 +70,7 @@ async function test() {
|
||||
false,
|
||||
url
|
||||
);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
|
||||
await loadPromise;
|
||||
|
||||
// Pass a dummy imageElement, if there isn't an imageElement, pageInfo.js
|
||||
|
||||
@@ -4,7 +4,7 @@ const URI =
|
||||
add_task(async function() {
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, URI);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, URI);
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, URI);
|
||||
|
||||
const pageInfo = BrowserPageInfo(
|
||||
|
||||
@@ -274,7 +274,7 @@ add_task(async function navigate_around() {
|
||||
for (let i = 0; i < 50; i++) {
|
||||
let url = urls[i % urls.length];
|
||||
info(`Navigating to ${url}...`);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, url);
|
||||
info(`Loaded ${url}.`);
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ add_task(async function testBFCache() {
|
||||
Services.prefs.setIntPref(AUTOPLAY_PREF, Ci.nsIAutoplay.BLOCKED);
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:home", async function(browser) {
|
||||
BrowserTestUtils.loadURI(browser, AUTOPLAY_PAGE);
|
||||
BrowserTestUtils.loadURIString(browser, AUTOPLAY_PAGE);
|
||||
await blockedIconShown();
|
||||
|
||||
gBrowser.goBack();
|
||||
@@ -247,7 +247,7 @@ add_task(async function testChangingBlockingSettingDuringNavigation() {
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:home", async function(browser) {
|
||||
await blockedIconHidden();
|
||||
BrowserTestUtils.loadURI(browser, AUTOPLAY_PAGE);
|
||||
BrowserTestUtils.loadURIString(browser, AUTOPLAY_PAGE);
|
||||
await blockedIconShown();
|
||||
Services.prefs.setIntPref(AUTOPLAY_PREF, Ci.nsIAutoplay.ALLOWED);
|
||||
|
||||
@@ -300,7 +300,7 @@ add_task(async function testBlockedAll() {
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:home", async function(browser) {
|
||||
await blockedIconHidden();
|
||||
BrowserTestUtils.loadURI(browser, MUTED_AUTOPLAY_PAGE);
|
||||
BrowserTestUtils.loadURIString(browser, MUTED_AUTOPLAY_PAGE);
|
||||
await blockedIconShown();
|
||||
|
||||
await openPermissionPopup();
|
||||
@@ -340,7 +340,7 @@ add_task(async function testMultiplePlayNotificationsFromJS() {
|
||||
|
||||
await blockedIconHidden();
|
||||
|
||||
BrowserTestUtils.loadURI(browser, AUTOPLAY_JS_PAGE);
|
||||
BrowserTestUtils.loadURIString(browser, AUTOPLAY_JS_PAGE);
|
||||
|
||||
await blockedIconShown();
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ add_task(async function testPermissionHints() {
|
||||
|
||||
await closePermissionPopup();
|
||||
let loaded = BrowserTestUtils.browserLoaded(browser);
|
||||
BrowserTestUtils.loadURI(browser, PERMISSIONS_PAGE);
|
||||
BrowserTestUtils.loadURIString(browser, PERMISSIONS_PAGE);
|
||||
await loaded;
|
||||
await openPermissionPopup();
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ function promiseTabLoadEvent(tab, url) {
|
||||
let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, handle);
|
||||
|
||||
if (url) {
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, url);
|
||||
}
|
||||
|
||||
return loaded;
|
||||
|
||||
@@ -39,7 +39,7 @@ function promiseTabLoadEvent(tab, url) {
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
if (url) {
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
}
|
||||
|
||||
return BrowserTestUtils.browserLoaded(browser, false, url);
|
||||
|
||||
@@ -173,7 +173,7 @@ function promiseTabLoadEvent(tab, url) {
|
||||
let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, handle);
|
||||
|
||||
if (url) {
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, url);
|
||||
}
|
||||
|
||||
return loaded;
|
||||
|
||||
@@ -34,7 +34,7 @@ add_task(async function test() {
|
||||
|
||||
// Mixed Script Test
|
||||
var url = HTTPS_TEST_ROOT + "file_bug822367_1.html";
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
|
||||
});
|
||||
|
||||
@@ -63,7 +63,7 @@ add_task(async function MixedTest1B() {
|
||||
// Mixed Display Test - Doorhanger should not appear
|
||||
add_task(async function MixedTest2() {
|
||||
var url = HTTPS_TEST_ROOT_2 + "file_bug822367_2.html";
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
|
||||
|
||||
await assertMixedContentBlockingState(gTestBrowser, {
|
||||
@@ -76,7 +76,7 @@ add_task(async function MixedTest2() {
|
||||
// Mixed Script and Display Test - User Override should cause both the script and the image to load.
|
||||
add_task(async function MixedTest3() {
|
||||
var url = HTTPS_TEST_ROOT + "file_bug822367_3.html";
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
|
||||
});
|
||||
|
||||
@@ -115,7 +115,7 @@ add_task(async function MixedTest3B() {
|
||||
// Location change - User override on one page doesn't propagate to another page after location change.
|
||||
add_task(async function MixedTest4() {
|
||||
var url = HTTPS_TEST_ROOT_2 + "file_bug822367_4.html";
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
|
||||
});
|
||||
|
||||
@@ -164,7 +164,7 @@ add_task(async function MixedTest4C() {
|
||||
// Mixed script attempts to load in a document.open()
|
||||
add_task(async function MixedTest5() {
|
||||
var url = HTTPS_TEST_ROOT + "file_bug822367_5.html";
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
|
||||
});
|
||||
|
||||
@@ -192,7 +192,7 @@ add_task(async function MixedTest5B() {
|
||||
// Mixed script attempts to load in a document.open() that is within an iframe.
|
||||
add_task(async function MixedTest6() {
|
||||
var url = HTTPS_TEST_ROOT_2 + "file_bug822367_6.html";
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
|
||||
});
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ add_task(async function test1() {
|
||||
// page and see if our decision is persistent
|
||||
url = HTTPS_TEST_ROOT_1 + "file_bug902156_2.html";
|
||||
browserLoaded = BrowserTestUtils.browserLoaded(browser, false, url);
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
await browserLoaded;
|
||||
|
||||
// The Control Center button should appear but isMixedContentBlocked should be NOT true,
|
||||
|
||||
@@ -449,7 +449,7 @@ async function noCertErrorTest(secureCheck) {
|
||||
gBrowser.selectedTab = newTab;
|
||||
|
||||
let promise = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
|
||||
BrowserTestUtils.loadURI(gBrowser, "https://nocert.example.com/");
|
||||
BrowserTestUtils.loadURIString(gBrowser, "https://nocert.example.com/");
|
||||
await promise;
|
||||
is(
|
||||
getIdentityMode(),
|
||||
@@ -497,7 +497,7 @@ add_task(async function httpsOnlyErrorTest() {
|
||||
gBrowser.selectedTab = newTab;
|
||||
|
||||
let promise = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
|
||||
BrowserTestUtils.loadURI(gBrowser, "http://nocert.example.com/");
|
||||
BrowserTestUtils.loadURIString(gBrowser, "http://nocert.example.com/");
|
||||
await promise;
|
||||
is(
|
||||
getIdentityMode(),
|
||||
@@ -672,7 +672,7 @@ async function aboutBlockedTest(secureCheck) {
|
||||
let newTab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedTab = newTab;
|
||||
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
|
||||
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
gBrowser.selectedBrowser,
|
||||
@@ -706,7 +706,7 @@ add_task(async function noCertErrorSecurityConnectionBGTest() {
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedTab = tab;
|
||||
let promise = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
|
||||
BrowserTestUtils.loadURI(gBrowser, "https://nocert.example.com/");
|
||||
BrowserTestUtils.loadURIString(gBrowser, "https://nocert.example.com/");
|
||||
await promise;
|
||||
|
||||
is(
|
||||
|
||||
@@ -43,7 +43,7 @@ function runTests() {
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(
|
||||
verifyUInotDegraded
|
||||
);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------
|
||||
|
||||
@@ -46,7 +46,7 @@ add_task(async function() {
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
|
||||
// Try deprecated versions
|
||||
BrowserTestUtils.loadURI(browser, HTTPS_TLS1_0);
|
||||
BrowserTestUtils.loadURIString(browser, HTTPS_TLS1_0);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
isSecurityState(browser, "broken");
|
||||
is(
|
||||
@@ -56,7 +56,7 @@ add_task(async function() {
|
||||
);
|
||||
await checkConnectionState("not-secure");
|
||||
|
||||
BrowserTestUtils.loadURI(browser, HTTPS_TLS1_1);
|
||||
BrowserTestUtils.loadURIString(browser, HTTPS_TLS1_1);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
isSecurityState(browser, "broken");
|
||||
is(
|
||||
@@ -67,14 +67,14 @@ add_task(async function() {
|
||||
await checkConnectionState("not-secure");
|
||||
|
||||
// Transition to secure
|
||||
BrowserTestUtils.loadURI(browser, HTTPS_TLS1_2);
|
||||
BrowserTestUtils.loadURIString(browser, HTTPS_TLS1_2);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
isSecurityState(browser, "secure");
|
||||
is(getIdentityMode(), "verifiedDomain", "Identity should be verified");
|
||||
await checkConnectionState("secure");
|
||||
|
||||
// Transition back to broken
|
||||
BrowserTestUtils.loadURI(browser, HTTPS_TLS1_1);
|
||||
BrowserTestUtils.loadURIString(browser, HTTPS_TLS1_1);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
isSecurityState(browser, "broken");
|
||||
is(
|
||||
@@ -85,7 +85,7 @@ add_task(async function() {
|
||||
await checkConnectionState("not-secure");
|
||||
|
||||
// TLS1.3 for completeness
|
||||
BrowserTestUtils.loadURI(browser, HTTPS_TLS1_3);
|
||||
BrowserTestUtils.loadURIString(browser, HTTPS_TLS1_3);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
isSecurityState(browser, "secure");
|
||||
is(getIdentityMode(), "verifiedDomain", "Identity should be verified");
|
||||
|
||||
@@ -7,19 +7,19 @@ const MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT = MOZILLA_PKIX_ERROR_BASE + 14;
|
||||
add_task(async function test() {
|
||||
await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
|
||||
let loaded = BrowserTestUtils.waitForErrorPage(browser);
|
||||
BrowserTestUtils.loadURI(browser, "https://self-signed.example.com");
|
||||
BrowserTestUtils.loadURIString(browser, "https://self-signed.example.com");
|
||||
await loaded;
|
||||
let securityInfo = gBrowser.securityUI.secInfo;
|
||||
ok(!securityInfo, "Found no security info");
|
||||
|
||||
loaded = BrowserTestUtils.browserLoaded(browser);
|
||||
BrowserTestUtils.loadURI(browser, "http://example.com");
|
||||
BrowserTestUtils.loadURIString(browser, "http://example.com");
|
||||
await loaded;
|
||||
securityInfo = gBrowser.securityUI.secInfo;
|
||||
ok(!securityInfo, "Found no security info");
|
||||
|
||||
loaded = BrowserTestUtils.browserLoaded(browser);
|
||||
BrowserTestUtils.loadURI(browser, "https://example.com");
|
||||
BrowserTestUtils.loadURIString(browser, "https://example.com");
|
||||
await loaded;
|
||||
securityInfo = gBrowser.securityUI.secInfo;
|
||||
ok(securityInfo, "Found some security info");
|
||||
|
||||
@@ -43,7 +43,7 @@ add_task(async function test() {
|
||||
false,
|
||||
"https://example.com/"
|
||||
);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, "https://example.com");
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, "https://example.com");
|
||||
await loaded;
|
||||
|
||||
is(classChanges, 1, "Changed the className once");
|
||||
|
||||
@@ -118,7 +118,10 @@ async function runTest(i, forward) {
|
||||
false,
|
||||
currentTest.location
|
||||
);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, currentTest.location);
|
||||
BrowserTestUtils.loadURIString(
|
||||
gBrowser.selectedBrowser,
|
||||
currentTest.location
|
||||
);
|
||||
await loaded;
|
||||
await popupHidden;
|
||||
ok(
|
||||
|
||||
@@ -33,7 +33,7 @@ add_task(async function() {
|
||||
"chrome://mochitests/content",
|
||||
"https://example.com"
|
||||
) + "dummy_page.html";
|
||||
BrowserTestUtils.loadURI(browser, uri);
|
||||
BrowserTestUtils.loadURIString(browser, uri);
|
||||
await BrowserTestUtils.browserLoaded(browser, false, uri);
|
||||
is(onLocationChangeCount, 1, "should have 1 onLocationChange event");
|
||||
is(onSecurityChangeCount, 1, "should have 1 onSecurityChange event");
|
||||
|
||||
@@ -100,7 +100,7 @@ function test1() {
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(
|
||||
checkUIForTest1
|
||||
);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
}
|
||||
|
||||
function testInsecure1() {
|
||||
@@ -110,7 +110,7 @@ function testInsecure1() {
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(
|
||||
checkUIForTest1
|
||||
);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
}
|
||||
|
||||
async function checkUIForTest1() {
|
||||
@@ -136,7 +136,7 @@ function test2() {
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(
|
||||
checkUIForTest2
|
||||
);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
}
|
||||
|
||||
async function checkUIForTest2() {
|
||||
@@ -163,7 +163,7 @@ function test3() {
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(
|
||||
checkLoadEventForTest3
|
||||
);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
}
|
||||
|
||||
function checkLoadEventForTest3() {
|
||||
@@ -184,7 +184,7 @@ function test4() {
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(
|
||||
checkLoadEventForTest4
|
||||
);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
}
|
||||
|
||||
function checkLoadEventForTest4() {
|
||||
@@ -210,7 +210,7 @@ function test5() {
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(
|
||||
checkLoadEventForTest5
|
||||
);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
}
|
||||
|
||||
function checkLoadEventForTest5() {
|
||||
@@ -240,7 +240,7 @@ function test6() {
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(
|
||||
checkLoadEventForTest6
|
||||
);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
}
|
||||
|
||||
function checkLoadEventForTest6() {
|
||||
@@ -264,7 +264,7 @@ function test7() {
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(
|
||||
checkLoadEventForTest7
|
||||
);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
}
|
||||
|
||||
function checkLoadEventForTest7() {
|
||||
@@ -289,7 +289,7 @@ function test8() {
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(
|
||||
checkLoadEventForTest8
|
||||
);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
}
|
||||
|
||||
function checkLoadEventForTest8() {
|
||||
@@ -318,7 +318,7 @@ function test9() {
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(
|
||||
checkLoadEventForTest9
|
||||
);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
}
|
||||
|
||||
function checkLoadEventForTest9() {
|
||||
|
||||
@@ -38,7 +38,7 @@ add_task(async function() {
|
||||
// Navigation from an http page to a https page with no mixed content
|
||||
// The http page loads an http image on unload
|
||||
url = HTTPS_TEST_ROOT_1 + "file_mixedContentFromOnunload_test1.html";
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
// check security state. Since current url is https and doesn't have any
|
||||
// mixed content resources, we expect it to be secure.
|
||||
@@ -51,10 +51,10 @@ add_task(async function() {
|
||||
// Navigation from an http page to a https page that has mixed display content
|
||||
// The https page loads an http image on unload
|
||||
url = HTTP_TEST_ROOT_2 + "file_mixedContentFromOnunload.html";
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
url = HTTPS_TEST_ROOT_2 + "file_mixedContentFromOnunload_test2.html";
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
isSecurityState(browser, "broken");
|
||||
await assertMixedContentBlockingState(browser, {
|
||||
|
||||
@@ -52,7 +52,7 @@ add_task(async function() {
|
||||
checkIdentityPopup("security-broken.svg");
|
||||
|
||||
// check that a warning is shown even without mixed content
|
||||
BrowserTestUtils.loadURI(
|
||||
BrowserTestUtils.loadURIString(
|
||||
gBrowser.selectedBrowser,
|
||||
"https://self-signed.example.com"
|
||||
);
|
||||
|
||||
@@ -49,7 +49,7 @@ async function run_testcase(testcase) {
|
||||
// seem to work with withNewTab.
|
||||
await BrowserTestUtils.withNewTab("about:blank", async browser => {
|
||||
// Navigate to the test URI.
|
||||
BrowserTestUtils.loadURI(browser, testcase.uri);
|
||||
BrowserTestUtils.loadURIString(browser, testcase.uri);
|
||||
if (!testcase.expectErrorPage) {
|
||||
await BrowserTestUtils.browserLoaded(browser, false, testcase.uri);
|
||||
} else {
|
||||
@@ -62,7 +62,7 @@ async function run_testcase(testcase) {
|
||||
);
|
||||
|
||||
// Navigate to a URI that should be secure.
|
||||
BrowserTestUtils.loadURI(browser, kSecureURI);
|
||||
BrowserTestUtils.loadURIString(browser, kSecureURI);
|
||||
await BrowserTestUtils.browserLoaded(browser, false, kSecureURI);
|
||||
let secureIdentityMode = window.document.getElementById("identity-box")
|
||||
.className;
|
||||
@@ -91,7 +91,7 @@ async function run_testcase(testcase) {
|
||||
is(secureIdentityMode, "verifiedDomain", "identity should start as secure");
|
||||
|
||||
// Navigate to the test URI.
|
||||
BrowserTestUtils.loadURI(browser, testcase.uri);
|
||||
BrowserTestUtils.loadURIString(browser, testcase.uri);
|
||||
if (!testcase.expectErrorPage) {
|
||||
await BrowserTestUtils.browserLoaded(browser, false, testcase.uri);
|
||||
} else {
|
||||
|
||||
@@ -21,7 +21,7 @@ add_task(async function() {
|
||||
|
||||
const TLS_HANDSHAKE_FAILURE_URI = "https://ssl3.example.com/";
|
||||
// Try to connect to a server where the TLS handshake will fail.
|
||||
BrowserTestUtils.loadURI(browser, TLS_HANDSHAKE_FAILURE_URI);
|
||||
BrowserTestUtils.loadURIString(browser, TLS_HANDSHAKE_FAILURE_URI);
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
browser,
|
||||
false,
|
||||
@@ -46,7 +46,7 @@ add_task(async function() {
|
||||
|
||||
const BAD_ABOUT_PAGE_URI = "about:somethingthatdoesnotexist";
|
||||
// Try to load an about: page that doesn't exist
|
||||
BrowserTestUtils.loadURI(browser, BAD_ABOUT_PAGE_URI);
|
||||
BrowserTestUtils.loadURIString(browser, BAD_ABOUT_PAGE_URI);
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
browser,
|
||||
false,
|
||||
@@ -148,7 +148,7 @@ add_task(async function() {
|
||||
const TLS_HANDSHAKE_FAILURE_URI = `https://localhost:${server.port}/`;
|
||||
// Try to connect to a server where the TLS handshake will succeed, but then
|
||||
// the server closes the connection right after.
|
||||
BrowserTestUtils.loadURI(browser, TLS_HANDSHAKE_FAILURE_URI);
|
||||
BrowserTestUtils.loadURIString(browser, TLS_HANDSHAKE_FAILURE_URI);
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
browser,
|
||||
false,
|
||||
|
||||
@@ -71,7 +71,7 @@ add_task(async function test1() {
|
||||
|
||||
// set up test 2
|
||||
let url = HTTP_TEST_ROOT + "test_no_mcb_on_http_site_font.html";
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(gTestBrowser);
|
||||
});
|
||||
|
||||
@@ -95,7 +95,7 @@ add_task(async function test2() {
|
||||
|
||||
// set up test 3
|
||||
let url = HTTP_TEST_ROOT + "test_no_mcb_on_http_site_font2.html";
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gTestBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(gTestBrowser);
|
||||
});
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ function promiseTabLoadEvent(tab, url) {
|
||||
let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, handle);
|
||||
|
||||
if (url) {
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, url);
|
||||
}
|
||||
|
||||
return loaded;
|
||||
@@ -414,7 +414,7 @@ async function assertMixedContentBlockingState(tabbrowser, states = {}) {
|
||||
|
||||
async function loadBadCertPage(url) {
|
||||
let loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
|
||||
await loaded;
|
||||
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], async function() {
|
||||
|
||||
@@ -16,7 +16,7 @@ function wait_for_event(browser, event) {
|
||||
async function test_on_browser(url, browser) {
|
||||
info(`run test for ${url}`);
|
||||
const startPromise = wait_for_event(browser, "DOMAudioPlaybackStarted");
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
await startPromise;
|
||||
await wait_for_event(browser, "DOMAudioPlaybackStopped");
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ function test_audio_in_browser() {
|
||||
}
|
||||
|
||||
async function test_on_browser(url, browser) {
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
await wait_for_event(browser, "DOMAudioPlaybackStarted");
|
||||
|
||||
var result = await SpecialPowers.spawn(browser, [], test_audio_in_browser);
|
||||
@@ -55,7 +55,7 @@ async function test_on_browser(url, browser) {
|
||||
}
|
||||
|
||||
async function test_visibility(url, browser) {
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
await wait_for_event(browser, "DOMAudioPlaybackStarted");
|
||||
|
||||
var result = await SpecialPowers.spawn(browser, [], test_audio_in_browser);
|
||||
|
||||
@@ -62,7 +62,7 @@ add_task(async function testSoundIndicatorShouldDisappearAfterTabNavigation() {
|
||||
await waitForTabSoundIndicatorAppears(tab);
|
||||
|
||||
info(`sound indicator should disappear after navigating tab to blank page`);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, "about:blank");
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, "about:blank");
|
||||
await waitForTabSoundIndicatorDisappears(tab);
|
||||
|
||||
info("remove tab");
|
||||
|
||||
@@ -42,7 +42,7 @@ add_task(async function mute_web_audio() {
|
||||
window.gBrowser,
|
||||
"about:blank"
|
||||
);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, PAGE);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, PAGE);
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
|
||||
info("- tab should be audible -");
|
||||
|
||||
@@ -40,7 +40,7 @@ add_task(async function should_not_show_sound_indicator_for_silent_video() {
|
||||
await waitForTabSoundIndicatorDisappears(tab);
|
||||
|
||||
info("- loading autoplay silent video -");
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, SILENT_PAGE);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, SILENT_PAGE);
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
await SpecialPowers.spawn(
|
||||
tab.linkedBrowser,
|
||||
@@ -69,7 +69,7 @@ add_task(
|
||||
await waitForTabSoundIndicatorDisappears(tab);
|
||||
|
||||
info("- loading autoplay almost silent video -");
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, ALMOST_SILENT_PAGE);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, ALMOST_SILENT_PAGE);
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
await SpecialPowers.spawn(
|
||||
tab.linkedBrowser,
|
||||
|
||||
@@ -59,7 +59,7 @@ add_task(async function testSoundIndicatorShouldDisappearAfterTabNavigation() {
|
||||
|
||||
info(`sound indicator should disappear after navigating tab to blank page`);
|
||||
await Promise.all([
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, "about:blank"),
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, "about:blank"),
|
||||
waitForTabSoundIndicatorDisappears(tab),
|
||||
]);
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ add_task(async function test_check_auth() {
|
||||
// Try a simple load:
|
||||
await checkDialog(
|
||||
"https://example.com/",
|
||||
browser => BrowserTestUtils.loadURI(browser, AUTH_URI),
|
||||
browser => BrowserTestUtils.loadURIString(browser, AUTH_URI),
|
||||
HOST,
|
||||
"chrome://global/skin/icons/defaultFavicon.svg",
|
||||
Ci.nsIPrompt.MODAL_TYPE_TAB
|
||||
|
||||
@@ -9,7 +9,7 @@ add_task(async function test_check_file_prompt() {
|
||||
await BrowserTestUtils.switchTab(gBrowser, initialTab);
|
||||
|
||||
let testHelper = async function(uri, expectedValue) {
|
||||
BrowserTestUtils.loadURI(browser, uri);
|
||||
BrowserTestUtils.loadURIString(browser, uri);
|
||||
await BrowserTestUtils.browserLoaded(browser, false, uri);
|
||||
let dialogFinishedShowing = TestUtils.topicObserved(
|
||||
"common-dialog-loaded"
|
||||
|
||||
@@ -45,7 +45,7 @@ add_task(async function test_multiple_dialog_navigation() {
|
||||
gBrowser,
|
||||
"https://example.org/gone"
|
||||
);
|
||||
BrowserTestUtils.loadURI(browser, "https://example.org/gone");
|
||||
BrowserTestUtils.loadURIString(browser, "https://example.org/gone");
|
||||
info("Waiting for the next page to load.");
|
||||
await loadedOtherPage;
|
||||
info(
|
||||
|
||||
@@ -20,7 +20,10 @@ add_task(async function test_subdialog_esc_does_not_cancel_load() {
|
||||
browser
|
||||
) {
|
||||
// Start loading a page
|
||||
let loadStartedPromise = BrowserTestUtils.loadURI(browser, TEST_LOAD_PAGE);
|
||||
let loadStartedPromise = BrowserTestUtils.loadURIString(
|
||||
browser,
|
||||
TEST_LOAD_PAGE
|
||||
);
|
||||
let loadedPromise = BrowserTestUtils.browserLoaded(browser);
|
||||
await loadStartedPromise;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ add_task(async function test_tabdialogbox_multiple_close_on_nav() {
|
||||
await Promise.all(dialogs.map(dialog => dialog._dialogReady));
|
||||
|
||||
// Navigate to a different page
|
||||
BrowserTestUtils.loadURI(browser, "https://example.org");
|
||||
BrowserTestUtils.loadURIString(browser, "https://example.org");
|
||||
|
||||
info("Waiting for dialogs to close.");
|
||||
await closedPromises;
|
||||
@@ -152,7 +152,7 @@ add_task(async function test_tabdialogbox_hide() {
|
||||
);
|
||||
|
||||
// Navigate to a different page
|
||||
BrowserTestUtils.loadURI(browser, "https://example.org");
|
||||
BrowserTestUtils.loadURIString(browser, "https://example.org");
|
||||
|
||||
info("Waiting for dialogs to close.");
|
||||
await closedPromises;
|
||||
|
||||
@@ -30,7 +30,7 @@ add_task(async function() {
|
||||
false,
|
||||
uriString
|
||||
);
|
||||
BrowserTestUtils.loadURI(viewSourceBrowser, uriString);
|
||||
BrowserTestUtils.loadURIString(viewSourceBrowser, uriString);
|
||||
let href = await promiseLoad;
|
||||
is(
|
||||
href,
|
||||
|
||||
@@ -536,7 +536,7 @@ async function test_cross_process_load() {
|
||||
);
|
||||
|
||||
// Go to a different process.
|
||||
BrowserTestUtils.loadURI(browser, "about:mozilla");
|
||||
BrowserTestUtils.loadURIString(browser, "about:mozilla");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
await soundPlayingStoppedPromise;
|
||||
|
||||
@@ -9,7 +9,7 @@ async function navigateTo(browser, urls, expectedPersist) {
|
||||
// Navigate to a bunch of urls
|
||||
for (let url of urls) {
|
||||
let loaded = BrowserTestUtils.browserLoaded(browser, false, url);
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
BrowserTestUtils.loadURIString(browser, url);
|
||||
await loaded;
|
||||
}
|
||||
// When we track pageshow event, save the evt.persisted on a doc element,
|
||||
|
||||
@@ -21,7 +21,7 @@ add_task(async function() {
|
||||
let win = await BrowserTestUtils.openNewBrowserWindow();
|
||||
|
||||
let browser = win.gBrowser.selectedBrowser;
|
||||
BrowserTestUtils.loadURI(browser, "http://example.com/");
|
||||
BrowserTestUtils.loadURIString(browser, "http://example.com/");
|
||||
await BrowserTestUtils.browserLoaded(browser, false, "http://example.com/");
|
||||
|
||||
await SpecialPowers.spawn(browser, [], () => {
|
||||
|
||||
@@ -27,7 +27,7 @@ add_task(async function test_contextmenu_openlink_after_tabnavigated() {
|
||||
info("Popup Shown");
|
||||
|
||||
info("Navigate the tab with the opened context menu");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank");
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, "about:blank");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
let awaitNewTabOpen = BrowserTestUtils.waitForNewTab(
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user