зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1485305 - browser/ tests Ensure loadURI always passes a triggeringPrincipal() r=Mossop
Differential Revision: https://phabricator.services.mozilla.com/D4552 --HG-- extra : source : 2cf17e4974823d09d0fdd1aef64e69e840b288a1 extra : intermediate-source : 4771e6948a78507aa95a56e5b324d87dc82e9009
This commit is contained in:
Родитель
82cf4833c8
Коммит
555f89c8d7
|
@ -10,7 +10,7 @@ add_task(async function() {
|
|||
let extraTab = gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
let haveChanged = waitForFavicon(extraTab.linkedBrowser, TEST_ROOT + "file_bug970276_favicon1.ico");
|
||||
|
||||
extraTab.linkedBrowser.loadURI(TEST_URL);
|
||||
BrowserTestUtils.loadURI(extraTab.linkedBrowser, TEST_URL);
|
||||
await BrowserTestUtils.browserLoaded(extraTab.linkedBrowser);
|
||||
await haveChanged;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ add_task(async function() {
|
|||
let expectedFavicon = TEST_ROOT + "file_generic_favicon.ico";
|
||||
let faviconPromise = waitForFavicon(extraTab.linkedBrowser, expectedFavicon);
|
||||
|
||||
extraTab.linkedBrowser.loadURI(TEST_URL);
|
||||
BrowserTestUtils.loadURI(extraTab.linkedBrowser, TEST_URL);
|
||||
await BrowserTestUtils.browserLoaded(extraTab.linkedBrowser);
|
||||
|
||||
await faviconPromise;
|
||||
|
|
|
@ -97,8 +97,8 @@ function test() {
|
|||
BrowserTestUtils.browserStopped(gBackgroundBrowser, kBasePage),
|
||||
BrowserTestUtils.browserStopped(gForegroundBrowser, kBasePage),
|
||||
];
|
||||
gBackgroundBrowser.loadURI(kBasePage);
|
||||
gForegroundBrowser.loadURI(kBasePage);
|
||||
BrowserTestUtils.loadURI(gBackgroundBrowser, kBasePage);
|
||||
BrowserTestUtils.loadURI(gForegroundBrowser, kBasePage);
|
||||
Promise.all(promises).then(startTest1);
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ function runTest(browser, url, next) {
|
|||
gAllNotificationsPos = 0;
|
||||
gNextTest = next;
|
||||
gTestBrowser = browser;
|
||||
browser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
}
|
||||
|
||||
function startTest1() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
add_task(async function() {
|
||||
let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, true);
|
||||
const htmlContent = "data:text/html, <iframe src='data:text/html,text text'></iframe>";
|
||||
gBrowser.loadURI(htmlContent);
|
||||
BrowserTestUtils.loadURI(gBrowser, htmlContent);
|
||||
await loadedPromise;
|
||||
|
||||
await ContentTask.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);
|
||||
gBrowser.loadURI("https://nocert.example.com/");
|
||||
BrowserTestUtils.loadURI(gBrowser, "https://nocert.example.com/");
|
||||
await promise;
|
||||
|
||||
await remote(() => {
|
||||
|
|
|
@ -3,7 +3,7 @@ function test() {
|
|||
gBrowser.addProgressListener(progressListener1);
|
||||
gBrowser.addProgressListener(progressListener2);
|
||||
gBrowser.addProgressListener(progressListener3);
|
||||
gBrowser.loadURI("data:text/plain,bug519216");
|
||||
BrowserTestUtils.loadURI(gBrowser, "data:text/plain,bug519216");
|
||||
}
|
||||
|
||||
var calledListener1 = false;
|
||||
|
|
|
@ -15,7 +15,9 @@ add_task(async function() {
|
|||
ok(true, "pageshow listener called: " + newwindow.gBrowser.currentURI.spec);
|
||||
resolve();
|
||||
});
|
||||
selectedBrowser.loadURI("data:text/html,<h1 id='h1'>Select Me</h1>");
|
||||
selectedBrowser.loadURI("data:text/html,<h1 id='h1'>Select Me</h1>", {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
});
|
||||
});
|
||||
|
||||
await SimpleTest.promiseFocus(newwindow);
|
||||
|
|
|
@ -24,5 +24,5 @@ function test() {
|
|||
gBrowser.removeTab(gBrowser.tabs[1]); // example.org tab
|
||||
finish();
|
||||
}
|
||||
newTab.linkedBrowser.loadURI("http://example.com");
|
||||
BrowserTestUtils.loadURI(newTab.linkedBrowser, "http://example.com");
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ add_task(async function test_remove_bookmark_with_tag_via_edit_bookmark() {
|
|||
|
||||
Assert.ok(await PlacesUtils.bookmarks.fetch({url: testURL}), "the test url is bookmarked");
|
||||
|
||||
gBrowser.loadURI(testURL);
|
||||
BrowserTestUtils.loadURI(gBrowser, testURL);
|
||||
|
||||
await BrowserTestUtils.waitForCondition(
|
||||
() => BookmarkingUI.status == BookmarkingUI.STATUS_STARRED,
|
||||
|
|
|
@ -30,5 +30,5 @@ function test() {
|
|||
}
|
||||
});
|
||||
|
||||
tab.linkedBrowser.loadURI("http://example.com/browser/browser/base/content/test/general/dummy_page.html");
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, "http://example.com/browser/browser/base/content/test/general/dummy_page.html");
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ add_task(async function() {
|
|||
|
||||
for (let test of tests) {
|
||||
let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
gBrowser.loadURI(test.url);
|
||||
BrowserTestUtils.loadURI(gBrowser, test.url);
|
||||
await loadedPromise;
|
||||
|
||||
info("Run subtest " + test.name);
|
||||
|
|
|
@ -82,7 +82,7 @@ async function expectFocusOnF6(backward, expectedDocument, expectedElement, onCo
|
|||
// Load a page and navigate between it and the chrome window.
|
||||
add_task(async function() {
|
||||
let page1Promise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
gBrowser.selectedBrowser.loadURI(testPage1);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPage1);
|
||||
await page1Promise;
|
||||
|
||||
// When the urlbar is focused, pressing F6 should focus the root of the content page.
|
||||
|
|
|
@ -14,7 +14,7 @@ function makeTest(name, startURL, startProcessIsRemote, endURL, endProcessIsRemo
|
|||
|
||||
// Load the initial URL and make sure we are in the right initial process
|
||||
info("Loading initial URL");
|
||||
browser.loadURI(startURL);
|
||||
BrowserTestUtils.loadURI(browser, startURL);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
is(browser.currentURI.spec, startURL, "Shouldn't have been redirected");
|
||||
|
|
|
@ -48,6 +48,7 @@ var check_history = async function() {
|
|||
|
||||
for (let i = 0; i < count; i++) {
|
||||
let entry = sessionHistory.entries[i];
|
||||
info("Checking History Entry:", entry.uri);
|
||||
is(entry.uri, gExpectedHistory.entries[i].uri, "Should have the right URI");
|
||||
is(entry.title, gExpectedHistory.entries[i].title, "Should have the right title");
|
||||
}
|
||||
|
@ -77,7 +78,10 @@ var waitForLoad = async function(uri) {
|
|||
// Waits for a load and updates the known history
|
||||
var waitForLoadWithFlags = async function(uri, flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE) {
|
||||
info("Loading " + uri + " flags = " + flags);
|
||||
gBrowser.selectedBrowser.loadURI(uri, { flags });
|
||||
gBrowser.selectedBrowser.loadURI(uri, {
|
||||
flags,
|
||||
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
});
|
||||
|
||||
await BrowserTestUtils.browserStopped(gBrowser);
|
||||
if (!(flags & Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY)) {
|
||||
|
|
|
@ -12,7 +12,7 @@ add_task(async function findbar_test() {
|
|||
let promise = ContentTask.spawn(newTab.linkedBrowser, null, async function() {
|
||||
await ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", false);
|
||||
});
|
||||
newTab.linkedBrowser.loadURI("http://example.com/browser/" +
|
||||
BrowserTestUtils.loadURI(newTab.linkedBrowser, "http://example.com/browser/" +
|
||||
"browser/base/content/test/general/test_bug628179.html");
|
||||
await promise;
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ async function testRealRefresh(refreshPage, delay) {
|
|||
}, async function(browser) {
|
||||
await pushPrefs(["accessibility.blockautorefresh", true]);
|
||||
|
||||
browser.loadURI(refreshPage + "?p=" + TARGET_PAGE + "&d=" + delay);
|
||||
BrowserTestUtils.loadURI(browser, refreshPage + "?p=" + TARGET_PAGE + "&d=" + delay);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
// Once browserLoaded resolves, all nsIWebProgressListener callbacks
|
||||
|
|
|
@ -62,7 +62,7 @@ add_task(async function navigate() {
|
|||
isAppTab = await isBrowserAppTab(browser);
|
||||
ok(isAppTab, "Docshell should think it is an app tab");
|
||||
|
||||
gBrowser.loadURI(DUMMY);
|
||||
BrowserTestUtils.loadURI(gBrowser, DUMMY);
|
||||
await BrowserTestUtils.browserStopped(gBrowser);
|
||||
loadFrameScript(browser);
|
||||
isAppTab = await isBrowserAppTab(browser);
|
||||
|
@ -76,7 +76,7 @@ add_task(async function navigate() {
|
|||
isAppTab = await isBrowserAppTab(browser);
|
||||
ok(isAppTab, "Docshell should think it is an app tab");
|
||||
|
||||
gBrowser.loadURI("about:robots");
|
||||
BrowserTestUtils.loadURI(gBrowser, "about:robots");
|
||||
await BrowserTestUtils.browserStopped(gBrowser);
|
||||
loadFrameScript(browser);
|
||||
isAppTab = await isBrowserAppTab(browser);
|
||||
|
|
|
@ -14,7 +14,7 @@ function triggerSave(aWindow, aCallback) {
|
|||
let testBrowser = aWindow.gBrowser.selectedBrowser;
|
||||
// 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";
|
||||
testBrowser.loadURI(testURI);
|
||||
BrowserTestUtils.loadURI(testBrowser, testURI);
|
||||
BrowserTestUtils.browserLoaded(testBrowser, false, testURI)
|
||||
.then(() => {
|
||||
waitForFocus(function() {
|
||||
|
|
|
@ -29,7 +29,7 @@ function triggerSave(aWindow, aCallback) {
|
|||
let testBrowser = aWindow.gBrowser.selectedBrowser;
|
||||
let testURI = "http://mochi.test:8888/browser/browser/base/content/test/general/navigating_window_with_download.html";
|
||||
windowObserver.setCallback(onUCTDialog);
|
||||
testBrowser.loadURI(testURI);
|
||||
BrowserTestUtils.loadURI(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);
|
||||
gBrowser.loadURI("http://mochi.test:8888/browser/browser/base/content/test/general/web_video.html");
|
||||
BrowserTestUtils.loadURI(gBrowser, "http://mochi.test:8888/browser/browser/base/content/test/general/web_video.html");
|
||||
await loadPromise;
|
||||
|
||||
let popupShownPromise = BrowserTestUtils.waitForEvent(document, "popupshown");
|
||||
|
|
|
@ -64,7 +64,7 @@ async function testSendReportAutomatically(testURL, suffix, errorURISuffix) {
|
|||
|
||||
// Load the page and wait for the error report submission.
|
||||
let promiseStatus = createReportResponseStatusPromise(URL_REPORTS + suffix);
|
||||
browser.loadURI(testURL);
|
||||
BrowserTestUtils.loadURI(browser, testURL);
|
||||
await BrowserTestUtils.waitForErrorPage(browser);
|
||||
|
||||
ok(!isErrorStatus(await promiseStatus),
|
||||
|
@ -88,7 +88,7 @@ async function testSetAutomatic(testURL, suffix, errorURISuffix) {
|
|||
let browser = tab.linkedBrowser;
|
||||
|
||||
// Load the page.
|
||||
browser.loadURI(testURL);
|
||||
BrowserTestUtils.loadURI(browser, testURL);
|
||||
await BrowserTestUtils.waitForErrorPage(browser);
|
||||
|
||||
// Check that we loaded the right error page.
|
||||
|
@ -129,7 +129,7 @@ async function testSendReportDisabled(testURL, errorURISuffix) {
|
|||
let browser = tab.linkedBrowser;
|
||||
|
||||
// Load the page.
|
||||
browser.loadURI(testURL);
|
||||
BrowserTestUtils.loadURI(browser, testURL);
|
||||
await BrowserTestUtils.waitForErrorPage(browser);
|
||||
|
||||
// Check that we loaded the right error page.
|
||||
|
|
|
@ -68,6 +68,6 @@ function promiseTabLoadEvent(aTab, aURL, aFinalURL) {
|
|||
aFinalURL = aURL;
|
||||
|
||||
info("Wait for load tab event");
|
||||
aTab.linkedBrowser.loadURI(aURL);
|
||||
BrowserTestUtils.loadURI(aTab.linkedBrowser, aURL);
|
||||
return BrowserTestUtils.browserLoaded(aTab.linkedBrowser, false, aFinalURL);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ add_task(async function() {
|
|||
SessionStore.forgetClosedWindow(0);
|
||||
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
tab.linkedBrowser.loadURI(uri);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, uri);
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
await TabStateFlusher.flush(tab.linkedBrowser);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ var clickTest = async function(tab) {
|
|||
};
|
||||
|
||||
function loadURI(tab, url) {
|
||||
tab.linkedBrowser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, url);
|
||||
return BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ function frame_script() {
|
|||
* Promise that resolves when the browser is no longer remote.
|
||||
*/
|
||||
function prepareNonRemoteBrowser(aWindow, browser) {
|
||||
browser.loadURI(NON_REMOTE_PAGE);
|
||||
BrowserTestUtils.loadURI(browser, NON_REMOTE_PAGE);
|
||||
return BrowserTestUtils.browserLoaded(browser);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
add_task(async function() {
|
||||
let testWindow = await BrowserTestUtils.openNewBrowserWindow();
|
||||
|
||||
testWindow.gBrowser.loadURI("data:text/html,<h1>A Page</h1>");
|
||||
BrowserTestUtils.loadURI(testWindow.gBrowser, "data:text/html,<h1>A Page</h1>");
|
||||
await BrowserTestUtils.browserLoaded(testWindow.gBrowser.selectedBrowser);
|
||||
|
||||
await SimpleTest.promiseFocus(testWindow.gBrowser.selectedBrowser);
|
||||
|
|
|
@ -21,7 +21,7 @@ add_task(async function() {
|
|||
|
||||
is(gBrowser.contentTitle, "Test Page", "Should have the right title.");
|
||||
|
||||
browser.loadURI(unknown_url);
|
||||
BrowserTestUtils.loadURI(browser, unknown_url);
|
||||
let win = await waitForNewWindow();
|
||||
is(win.location, "chrome://mozapps/content/downloads/unknownContentType.xul",
|
||||
"Should have seen the unknown content dialog.");
|
||||
|
|
|
@ -303,7 +303,7 @@ var FullZoomHelper = {
|
|||
resolve();
|
||||
});
|
||||
|
||||
tab.linkedBrowser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, url);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ async function test() {
|
|||
let url = "https://example.com/browser/browser/base/content/test/pageinfo/image.html";
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, url);
|
||||
gBrowser.selectedBrowser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
|
||||
await loadPromise;
|
||||
|
||||
// Pass a dummy imageElement, if there isn't an imageElement, pageInfo.js
|
||||
|
|
|
@ -46,5 +46,5 @@ function test() {
|
|||
}, {capture: true, once: true});
|
||||
});
|
||||
|
||||
gBrowser.loadURI(URI);
|
||||
BrowserTestUtils.loadURI(gBrowser, URI);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ function test() {
|
|||
}, {capture: true, once: true});
|
||||
});
|
||||
|
||||
gBrowser.selectedBrowser.loadURI(
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser,
|
||||
"data:text/html," +
|
||||
"<html>" +
|
||||
" <head>" +
|
||||
|
|
|
@ -35,5 +35,5 @@ function test() {
|
|||
}, {capture: true, once: true});
|
||||
});
|
||||
|
||||
gBrowser.selectedBrowser.loadURI(URI);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, URI);
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ add_task(async function testChromeHearsPluginCrashFirst() {
|
|||
let win = await BrowserTestUtils.openNewBrowserWindow({remote: true});
|
||||
let browser = win.gBrowser.selectedBrowser;
|
||||
|
||||
browser.loadURI(CRASH_URL);
|
||||
BrowserTestUtils.loadURI(browser, CRASH_URL);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
// In this case, we want the <object> to match the -moz-handler-crashed
|
||||
|
@ -205,7 +205,7 @@ add_task(async function testContentHearsCrashFirst() {
|
|||
let win = await BrowserTestUtils.openNewBrowserWindow({remote: true});
|
||||
let browser = win.gBrowser.selectedBrowser;
|
||||
|
||||
browser.loadURI(CRASH_URL);
|
||||
BrowserTestUtils.loadURI(browser, CRASH_URL);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
// In this case, we want the <object> to match the -moz-handler-crashed
|
||||
|
|
|
@ -36,7 +36,7 @@ function promiseTabLoadEvent(tab, url) {
|
|||
let browser = tab.linkedBrowser;
|
||||
|
||||
if (url) {
|
||||
browser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
}
|
||||
|
||||
return BrowserTestUtils.browserLoaded(browser, false, url);
|
||||
|
|
|
@ -275,7 +275,7 @@ async function noCertErrorTest(secureCheck) {
|
|||
gBrowser.selectedTab = newTab;
|
||||
|
||||
let promise = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
|
||||
gBrowser.loadURI("https://nocert.example.com/");
|
||||
BrowserTestUtils.loadURI(gBrowser, "https://nocert.example.com/");
|
||||
await promise;
|
||||
is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
|
||||
is(getConnectionState(), "not-secure", "Connection should be file");
|
||||
|
|
|
@ -40,7 +40,7 @@ function runTests() {
|
|||
// Starting the test
|
||||
var url = PRE_PATH + "file_csp_block_all_mixedcontent.html";
|
||||
BrowserTestUtils.browserLoaded(gTestBrowser, false, url).then(verifyUInotDegraded);
|
||||
gTestBrowser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(gTestBrowser, url);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------
|
||||
|
|
|
@ -77,7 +77,7 @@ const PROBE_TESTS = [
|
|||
category: "back",
|
||||
|
||||
async prepare(browser) {
|
||||
browser.loadURI(PAGE_2);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_2);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
},
|
||||
|
||||
|
@ -96,7 +96,7 @@ const PROBE_TESTS = [
|
|||
category: "forward",
|
||||
|
||||
async prepare(browser) {
|
||||
browser.loadURI(PAGE_2);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_2);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
let pageShow =
|
||||
BrowserTestUtils.waitForContentEvent(browser, "pageshow");
|
||||
|
@ -119,9 +119,9 @@ const PROBE_TESTS = [
|
|||
category: "historyNavigation",
|
||||
|
||||
async prepare(browser) {
|
||||
browser.loadURI(PAGE_2);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_2);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
browser.loadURI("http://example.com");
|
||||
BrowserTestUtils.loadURI(browser, "http://example.com");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
await TabStateFlusher.flush(browser);
|
||||
},
|
||||
|
@ -141,9 +141,9 @@ const PROBE_TESTS = [
|
|||
category: "historyNavigation",
|
||||
|
||||
async prepare(browser) {
|
||||
browser.loadURI(PAGE_2);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_2);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
browser.loadURI("http://example.com");
|
||||
BrowserTestUtils.loadURI(browser, "http://example.com");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
let pageShow =
|
||||
BrowserTestUtils.waitForContentEvent(browser, "pageshow");
|
||||
|
|
|
@ -26,7 +26,7 @@ add_task(async function() {
|
|||
let viewSourceBrowser = viewSourceTab.linkedBrowser;
|
||||
let promiseLoad =
|
||||
BrowserTestUtils.browserLoaded(viewSourceBrowser, false, uriString);
|
||||
viewSourceBrowser.loadURI(uriString);
|
||||
BrowserTestUtils.loadURI(viewSourceBrowser, uriString);
|
||||
let href = await promiseLoad;
|
||||
is(href, uriString,
|
||||
"Check file:// URI loads in a browser that was previously for view-source");
|
||||
|
|
|
@ -369,7 +369,7 @@ async function test_cross_process_load() {
|
|||
);
|
||||
|
||||
// Go to a different process.
|
||||
browser.loadURI("about:mozilla");
|
||||
BrowserTestUtils.loadURI(browser, "about:mozilla");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
await soundPlayingStoppedPromise;
|
||||
|
|
|
@ -17,7 +17,7 @@ add_task(async function test_contextmenu_openlink_after_tabnavigated() {
|
|||
info("Popup Shown");
|
||||
|
||||
info("Navigate the tab with the opened context menu");
|
||||
gBrowser.selectedBrowser.loadURI("about:blank");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
let awaitNewTabOpen = BrowserTestUtils.waitForNewTab(gBrowser, "http://example.com/");
|
||||
|
|
|
@ -62,7 +62,7 @@ add_task(async function() {
|
|||
|
||||
// Check that same-origin load doesn't break the affinity.
|
||||
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser, false, TEST_HTTP + "foo");
|
||||
httpBrowser.loadURI(TEST_HTTP + "foo");
|
||||
BrowserTestUtils.loadURI(httpBrowser, TEST_HTTP + "foo");
|
||||
await promiseLoad;
|
||||
await CheckBrowserInPid(httpBrowser, filePid,
|
||||
"Check that http tab still in file content process after same origin load.");
|
||||
|
@ -93,7 +93,7 @@ add_task(async function() {
|
|||
|
||||
// Check that file:// URI load doesn't break the affinity.
|
||||
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser, false, uriString);
|
||||
httpBrowser.loadURI(uriString);
|
||||
BrowserTestUtils.loadURI(httpBrowser, uriString);
|
||||
await promiseLoad;
|
||||
await CheckBrowserInPid(httpBrowser, filePid,
|
||||
"Check that http tab still in file content process after file:// load.");
|
||||
|
@ -109,7 +109,7 @@ add_task(async function() {
|
|||
|
||||
// Check that cross-origin load does break the affinity.
|
||||
promiseLoad = BrowserTestUtils.browserLoaded(httpBrowser, false, TEST_CROSS_ORIGIN);
|
||||
httpBrowser.loadURI(TEST_CROSS_ORIGIN);
|
||||
BrowserTestUtils.loadURI(httpBrowser, TEST_CROSS_ORIGIN);
|
||||
await promiseLoad;
|
||||
await CheckBrowserNotInPid(httpBrowser, filePid,
|
||||
"Check that http tab not in file content process after cross origin load.");
|
||||
|
|
|
@ -36,7 +36,7 @@ add_task(async function() {
|
|||
let openedBrowser = openedTab.linkedBrowser;
|
||||
|
||||
// Ensure that new file:// tab can be navigated to web content.
|
||||
openedBrowser.loadURI(WEB_ADDRESS);
|
||||
BrowserTestUtils.loadURI(openedBrowser, "http://example.org/");
|
||||
let href = await BrowserTestUtils.browserLoaded(openedBrowser, false, WEB_ADDRESS);
|
||||
is(href, WEB_ADDRESS,
|
||||
"Check that new file:// page has navigated successfully to web content");
|
||||
|
|
|
@ -20,7 +20,7 @@ add_task(async function() {
|
|||
// Navigate to data URI.
|
||||
let promiseLoad = BrowserTestUtils.browserLoaded(fileBrowser, false,
|
||||
DATA_URI);
|
||||
fileBrowser.loadURI(DATA_URI);
|
||||
BrowserTestUtils.loadURI(fileBrowser, DATA_URI);
|
||||
let href = await promiseLoad;
|
||||
is(href, DATA_URI, "Check data URI loaded.");
|
||||
let dataPid = await ContentTask.spawn(fileBrowser, null, () => {
|
||||
|
|
|
@ -55,7 +55,7 @@ var tests = [
|
|||
loadTabInWindow(window, function(tab) {
|
||||
// Load a new URL and then immediately stop it, to simulate a page load
|
||||
// error.
|
||||
tab.linkedBrowser.loadURI("http://test1.example.com");
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, "http://test1.example.com");
|
||||
tab.linkedBrowser.stop();
|
||||
is(gURLBar.textValue, "example.com", "URL bar had user/pass stripped after load error");
|
||||
gBrowser.removeTab(tab);
|
||||
|
|
|
@ -14,9 +14,9 @@ add_task(async function() {
|
|||
let loaded1 = BrowserTestUtils.browserLoaded(deletedURLTab.linkedBrowser, false, testURL);
|
||||
let loaded2 = BrowserTestUtils.browserLoaded(fullURLTab.linkedBrowser, false, testURL);
|
||||
let loaded3 = BrowserTestUtils.browserLoaded(partialURLTab.linkedBrowser, false, testURL);
|
||||
deletedURLTab.linkedBrowser.loadURI(testURL);
|
||||
fullURLTab.linkedBrowser.loadURI(testURL);
|
||||
partialURLTab.linkedBrowser.loadURI(testURL);
|
||||
BrowserTestUtils.loadURI(deletedURLTab.linkedBrowser, testURL);
|
||||
BrowserTestUtils.loadURI(fullURLTab.linkedBrowser, testURL);
|
||||
BrowserTestUtils.loadURI(partialURLTab.linkedBrowser, testURL);
|
||||
await Promise.all([loaded1, loaded2, loaded3]);
|
||||
|
||||
testURL = gURLBar.trimValue(testURL);
|
||||
|
|
|
@ -109,7 +109,7 @@ function delayed(aIsSelectedTab) {
|
|||
|
||||
if (!aIsSelectedTab) {
|
||||
// If this was a background request, go on a foreground request.
|
||||
gBrowser.selectedBrowser.loadURI(REDIRECT_FROM + "#FG");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, REDIRECT_FROM + "#FG");
|
||||
} else {
|
||||
// Othrewise, nothing to do remains.
|
||||
finish();
|
||||
|
|
|
@ -59,7 +59,7 @@ add_task(async function step_3() {
|
|||
add_task(async function step_4() {
|
||||
info("Running step 4 - ensure we don't register subframes as open pages");
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
tab.linkedBrowser.loadURI('data:text/html,<body><iframe src=""></iframe></body>');
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, 'data:text/html,<body><iframe src=""></iframe></body>');
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
|
||||
await ContentTask.spawn(tab.linkedBrowser, null, async function() {
|
||||
|
@ -82,7 +82,7 @@ add_task(async function step_6() {
|
|||
info("Running step 6 - check swapBrowsersAndCloseOther preserves registered switch-to-tab result");
|
||||
let tabToKeep = BrowserTestUtils.addTab(gBrowser);
|
||||
let tab = BrowserTestUtils.addTab(gBrowser);
|
||||
tab.linkedBrowser.loadURI("about:mozilla");
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, "about:mozilla");
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
|
||||
gBrowser.updateBrowserRemoteness(tabToKeep.linkedBrowser, tab.linkedBrowser.isRemoteBrowser);
|
||||
|
@ -132,7 +132,7 @@ function loadTab(tab, url) {
|
|||
});
|
||||
|
||||
info("Loading page: " + url);
|
||||
tab.linkedBrowser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, url);
|
||||
return Promise.all([ loaded, visited ]);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ add_task(async function clearURLBarAfterParentProcessURLInExistingTab() {
|
|||
newTabBrowser.addEventListener("Initialized", async function() {
|
||||
resolve(gBrowser.selectedTab);
|
||||
}, {capture: true, once: true});
|
||||
newTabBrowser.loadURI("about:preferences");
|
||||
BrowserTestUtils.loadURI(newTabBrowser, "about:preferences");
|
||||
});
|
||||
document.getElementById("home-button").click();
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, HomePage.get());
|
||||
|
|
|
@ -69,7 +69,7 @@ add_task(async function() {
|
|||
|
||||
let promiseLoaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser,
|
||||
false, "http://example.com/");
|
||||
gBrowser.loadURI("http://example.com/");
|
||||
BrowserTestUtils.loadURI(gBrowser, "http://example.com/");
|
||||
await promiseLoaded;
|
||||
|
||||
await testCopy("example.com", "http://example.com/");
|
||||
|
|
|
@ -100,12 +100,12 @@ add_task(async function() {
|
|||
|
||||
// Navigate away from the starting page to force about:addons to load
|
||||
// in a new tab during the tests below.
|
||||
gBrowser.selectedBrowser.loadURI("about:robots");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:robots");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
registerCleanupFunction(async function() {
|
||||
// Return to about:blank when we're done
|
||||
gBrowser.selectedBrowser.loadURI("about:blank");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
});
|
||||
|
||||
|
|
|
@ -41,12 +41,12 @@ add_task(async function setup() {
|
|||
|
||||
// Navigate away from the initial page so that about:addons always
|
||||
// opens in a new tab during tests
|
||||
gBrowser.selectedBrowser.loadURI("about:robots");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:robots");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
registerCleanupFunction(async function() {
|
||||
// Return to about:blank when we're done
|
||||
gBrowser.selectedBrowser.loadURI("about:blank");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,12 +21,12 @@ add_task(async function setup() {
|
|||
|
||||
// Navigate away from the initial page so that about:addons always
|
||||
// opens in a new tab during tests
|
||||
gBrowser.selectedBrowser.loadURI("about:robots");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:robots");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
registerCleanupFunction(async function() {
|
||||
// Return to about:blank when we're done
|
||||
gBrowser.selectedBrowser.loadURI("about:blank");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const INSTALL_PAGE = `${BASE}/file_install_extensions.html`;
|
||||
|
||||
async function installTrigger(filename) {
|
||||
gBrowser.selectedBrowser.loadURI(INSTALL_PAGE);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, INSTALL_PAGE);
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
ContentTask.spawn(gBrowser.selectedBrowser, `${BASE}/${filename}`, async function(url) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const INSTALL_PAGE = `${BASE}/file_install_extensions.html`;
|
||||
|
||||
async function installMozAM(filename) {
|
||||
gBrowser.selectedBrowser.loadURI(INSTALL_PAGE);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, INSTALL_PAGE);
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
await ContentTask.spawn(gBrowser.selectedBrowser, `${BASE}/${filename}`, async function(url) {
|
||||
|
|
|
@ -15,7 +15,7 @@ add_task(async function test_unsigned() {
|
|||
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
|
||||
|
||||
gBrowser.selectedBrowser.loadURI(`${BASE}/file_install_extensions.html`);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, `${BASE}/file_install_extensions.html`);
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
ContentTask.spawn(gBrowser.selectedBrowser, `${BASE}/browser_webext_unsigned.xpi`, async function(url) {
|
||||
|
|
|
@ -19,7 +19,7 @@ add_task(async function setup() {
|
|||
async function testUpdateNoPrompt(filename, id,
|
||||
initialVersion = "1.0", updateVersion = "2.0") {
|
||||
// Navigate away to ensure that BrowserOpenAddonMgr() opens a new tab
|
||||
gBrowser.selectedBrowser.loadURI("about:robots");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:robots");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
// Install initial version of the test extension
|
||||
|
|
|
@ -401,7 +401,7 @@ async function interactiveUpdateTest(autoUpdate, checkFn) {
|
|||
|
||||
// Navigate away from the starting page to force about:addons to load
|
||||
// in a new tab during the tests below.
|
||||
gBrowser.selectedBrowser.loadURI("about:robots");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:robots");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
// Install version 1.0 of the test extension
|
||||
|
|
|
@ -531,7 +531,7 @@ var gTests = [
|
|||
run: async function checkNoAlwaysOnHttp() {
|
||||
// Load an http page instead of the https version.
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
browser.loadURI(browser.documentURI.spec.replace("https://", "http://"));
|
||||
BrowserTestUtils.loadURI(browser, browser.documentURI.spec.replace("https://", "http://"));
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
// Initially set both permissions to 'allow'.
|
||||
|
|
|
@ -21,7 +21,7 @@ add_task(async function test_exit_background_customize_mode() {
|
|||
await BrowserTestUtils.switchTab(gBrowser, nonCustomizingTab);
|
||||
await finishedCustomizing;
|
||||
|
||||
custTab.linkedBrowser.loadURI("http://example.com");
|
||||
BrowserTestUtils.loadURI(custTab.linkedBrowser, "http://example.com");
|
||||
await BrowserTestUtils.browserLoaded(custTab.linkedBrowser);
|
||||
|
||||
Assert.equal(gBrowser.tabContainer.querySelector("tab[customizemode=true]"),
|
||||
|
|
|
@ -7,7 +7,7 @@ add_task(async function() {
|
|||
let notificationValue = "Protocol Registration: web+testprotocol";
|
||||
let testURI = TEST_PATH + "browser_registerProtocolHandler_notification.html";
|
||||
|
||||
window.gBrowser.selectedBrowser.loadURI(testURI);
|
||||
BrowserTestUtils.loadURI(window.gBrowser.selectedBrowser, testURI);
|
||||
await TestUtils.waitForCondition(function() {
|
||||
// Do not start until the notification is up
|
||||
let notificationBox = window.gBrowser.getNotificationBox();
|
||||
|
|
|
@ -106,7 +106,7 @@ add_task(async function test_remote_window_open_data_uri2() {
|
|||
// The iframe test2.html will fetch test2.js, which will have cookies.
|
||||
const DATA_URI = `data:text/html,
|
||||
<iframe id="iframe1" src="http://mochi.test:8888/browser/browser/components/originattributes/test/browser/test2.html"></iframe>`;
|
||||
browser.loadURI(DATA_URI);
|
||||
BrowserTestUtils.loadURI(browser, DATA_URI);
|
||||
await BrowserTestUtils.browserLoaded(browser, true);
|
||||
|
||||
await ContentTask.spawn(browser, {}, async function() {
|
||||
|
|
|
@ -22,7 +22,7 @@ add_task(async function test_blob_uri_inherit_oa_from_content() {
|
|||
// First we load a normal web page.
|
||||
let win = await BrowserTestUtils.openNewBrowserWindow({ remote: true });
|
||||
let browser = win.gBrowser.selectedBrowser;
|
||||
browser.loadURI(BASE_URI);
|
||||
BrowserTestUtils.loadURI(browser, BASE_URI);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
// Then navigate to the blob: URI.
|
||||
|
|
|
@ -12,7 +12,7 @@ add_task(async function test_remote_window_open_js_uri() {
|
|||
|
||||
Assert.ok(browser.isRemoteBrowser, "should be a remote browser");
|
||||
|
||||
browser.loadURI(`javascript:1;`);
|
||||
BrowserTestUtils.loadURI(browser, `javascript:1;`);
|
||||
await ContentTask.spawn(browser, {}, async function() {
|
||||
info("origin " + content.document.nodePrincipal.origin);
|
||||
|
||||
|
@ -35,7 +35,7 @@ add_task(async function test_remote_window_open_js_uri2() {
|
|||
|
||||
Assert.ok(browser.isRemoteBrowser, "should be a remote browser");
|
||||
|
||||
browser.loadURI(`javascript:
|
||||
BrowserTestUtils.loadURI(browser, `javascript:
|
||||
let iframe = document.createElement("iframe");
|
||||
iframe.src = "http://example.com";
|
||||
iframe.id = "iframe1";
|
||||
|
|
|
@ -10,7 +10,7 @@ add_task(async function test() {
|
|||
info("Creating a normal window...");
|
||||
let win = await BrowserTestUtils.openNewBrowserWindow();
|
||||
let tab = win.gBrowser.selectedBrowser;
|
||||
tab.loadURI(BASE_URI);
|
||||
BrowserTestUtils.loadURI(tab, BASE_URI);
|
||||
await BrowserTestUtils.browserLoaded(tab);
|
||||
|
||||
let blobURL;
|
||||
|
@ -25,7 +25,7 @@ add_task(async function test() {
|
|||
info("Creating a private window...");
|
||||
let privateWin = await BrowserTestUtils.openNewBrowserWindow({ private: true });
|
||||
let privateTab = privateWin.gBrowser.selectedBrowser;
|
||||
privateTab.loadURI(BASE_URI);
|
||||
BrowserTestUtils.loadURI(privateTab, BASE_URI);
|
||||
await BrowserTestUtils.browserLoaded(privateTab);
|
||||
|
||||
await ContentTask.spawn(privateTab, blobURL, function(url) {
|
||||
|
|
|
@ -27,7 +27,7 @@ add_task(async function test() {
|
|||
// Step 1
|
||||
let non_private_browser = gBrowser.selectedBrowser;
|
||||
let url = prefix + "?action=set&name=test&value=value&initial=true";
|
||||
non_private_browser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(non_private_browser, url);
|
||||
await BrowserTestUtils.browserLoaded(non_private_browser, false, url);
|
||||
|
||||
|
||||
|
@ -35,13 +35,13 @@ add_task(async function test() {
|
|||
let private_window = await BrowserTestUtils.openNewBrowserWindow({ private: true });
|
||||
let private_browser = private_window.getBrowser().selectedBrowser;
|
||||
url = prefix + "?action=set&name=test2&value=value2";
|
||||
private_browser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(private_browser, url);
|
||||
await BrowserTestUtils.browserLoaded(private_browser, false, url);
|
||||
|
||||
|
||||
// Step 3
|
||||
url = prefix + "?action=get&name=test2";
|
||||
non_private_browser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(non_private_browser, url);
|
||||
await BrowserTestUtils.browserLoaded(non_private_browser, false, url);
|
||||
let elts = await getElts(non_private_browser);
|
||||
isnot(elts[0], "value2", "public window shouldn't see private storage");
|
||||
|
@ -50,7 +50,7 @@ add_task(async function test() {
|
|||
|
||||
// Step 4
|
||||
url = prefix + "?action=get&name=test";
|
||||
private_browser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(private_browser, url);
|
||||
await BrowserTestUtils.browserLoaded(private_browser, false, url);
|
||||
elts = await getElts(private_browser);
|
||||
isnot(elts[0], "value", "private window shouldn't see public storage");
|
||||
|
@ -66,7 +66,7 @@ add_task(async function test() {
|
|||
private_browser = private_window.getBrowser().selectedBrowser;
|
||||
|
||||
url = prefix + "?action=get&name=test2";
|
||||
private_browser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(private_browser, url);
|
||||
await BrowserTestUtils.browserLoaded(private_browser, false, url);
|
||||
elts = await getElts(private_browser);
|
||||
isnot(elts[0], "value2", "public window shouldn't see cleared private storage");
|
||||
|
@ -82,14 +82,14 @@ add_task(async function test() {
|
|||
private_browser = private_window.getBrowser().selectedBrowser;
|
||||
|
||||
url = prefix + "?action=set&name=test3&value=value3";
|
||||
private_browser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(private_browser, url);
|
||||
await BrowserTestUtils.browserLoaded(private_browser, false, url);
|
||||
elts = await getElts(private_browser);
|
||||
is(elts[1], "1", "private window should only see new private items");
|
||||
|
||||
// Cleanup.
|
||||
url = prefix + "?final=true";
|
||||
non_private_browser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(non_private_browser, url);
|
||||
await BrowserTestUtils.browserLoaded(non_private_browser, false, url);
|
||||
private_window.close();
|
||||
});
|
||||
|
|
|
@ -20,7 +20,7 @@ add_task(async function test() {
|
|||
|
||||
let privateWin = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
||||
let privateBrowser = privateWin.gBrowser.selectedBrowser;
|
||||
privateBrowser.loadURI(testURI);
|
||||
BrowserTestUtils.loadURI(privateBrowser, testURI);
|
||||
await BrowserTestUtils.browserLoaded(privateBrowser);
|
||||
|
||||
info("Test on private window");
|
||||
|
@ -29,7 +29,7 @@ add_task(async function test() {
|
|||
|
||||
let win = await BrowserTestUtils.openNewBrowserWindow();
|
||||
let browser = win.gBrowser.selectedBrowser;
|
||||
browser.loadURI(testURI);
|
||||
BrowserTestUtils.loadURI(browser, testURI);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
info("Test on public window");
|
||||
|
|
|
@ -36,14 +36,14 @@ add_task(async function test() {
|
|||
|
||||
let win = await BrowserTestUtils.openNewBrowserWindow();
|
||||
let browser = win.gBrowser.selectedBrowser;
|
||||
browser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(browser, testPageURL);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
await checkGeolocation(false, win);
|
||||
|
||||
let privateWin = await BrowserTestUtils.openNewBrowserWindow({private: true});
|
||||
let privateBrowser = privateWin.gBrowser.selectedBrowser;
|
||||
privateBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(privateBrowser, testPageURL);
|
||||
await BrowserTestUtils.browserLoaded(privateBrowser);
|
||||
|
||||
await checkGeolocation(true, privateWin);
|
||||
|
|
|
@ -13,8 +13,7 @@
|
|||
let browser = win.gBrowser.selectedBrowser;
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
browser.loadURI(
|
||||
"http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/" +
|
||||
BrowserTestUtils.loadURI(browser, "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/" +
|
||||
"browser_privatebrowsing_localStorage_page2.html");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ add_task(async function test() {
|
|||
|
||||
}, {once: true});
|
||||
|
||||
aWindow.gBrowser.selectedBrowser.loadURI(testURI);
|
||||
BrowserTestUtils.loadURI(aWindow.gBrowser.selectedBrowser, testURI);
|
||||
}
|
||||
|
||||
let win1 = await BrowserTestUtils.openNewBrowserWindow();
|
||||
|
|
|
@ -32,7 +32,7 @@ function test() {
|
|||
aCallback();
|
||||
});
|
||||
|
||||
aWindow.gBrowser.selectedBrowser.loadURI(testURI);
|
||||
BrowserTestUtils.loadURI(aWindow.gBrowser.selectedBrowser, testURI);
|
||||
}
|
||||
|
||||
function openPrivateBrowsingModeByUI(aWindow, aCallback) {
|
||||
|
|
|
@ -40,7 +40,7 @@ function testMalware(data) {
|
|||
|
||||
// Now launch the unwanted software test
|
||||
onDOMContentLoaded(testUnwanted);
|
||||
gBrowser.loadURI("http://www.itisatrap.org/firefox/unwanted.html");
|
||||
BrowserTestUtils.loadURI(gBrowser, "http://www.itisatrap.org/firefox/unwanted.html");
|
||||
}
|
||||
|
||||
function testUnwanted(data) {
|
||||
|
@ -51,7 +51,7 @@ function testUnwanted(data) {
|
|||
|
||||
// Now launch the phishing test
|
||||
onDOMContentLoaded(testPhishing);
|
||||
gBrowser.loadURI("http://www.itisatrap.org/firefox/its-a-trap.html");
|
||||
BrowserTestUtils.loadURI(gBrowser, "http://www.itisatrap.org/firefox/its-a-trap.html");
|
||||
}
|
||||
|
||||
function testPhishing(data) {
|
||||
|
|
|
@ -32,7 +32,7 @@ function check_menu_at_page(url, testFn) {
|
|||
let dclPromise = ContentTask.spawn(browser, null, async function() {
|
||||
await ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", false);
|
||||
});
|
||||
browser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
await dclPromise;
|
||||
|
||||
let menu = document.getElementById("menu_HelpPopup");
|
||||
|
|
|
@ -201,7 +201,9 @@ add_task(async function testShiftMiddleClick() {
|
|||
|
||||
add_task(async function testRightClick() {
|
||||
preTabNo = gBrowser.tabs.length;
|
||||
gBrowser.selectedBrowser.loadURI("about:blank");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank", {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
|
||||
});
|
||||
await new Promise(resolve => {
|
||||
setTimeout(function() {
|
||||
is(gBrowser.tabs.length, preTabNo, "RightClick did not open new tab");
|
||||
|
@ -255,7 +257,9 @@ add_task(async function asyncCleanup() {
|
|||
while (gBrowser.tabs.length != 1) {
|
||||
gBrowser.removeTab(gBrowser.tabs[0], {animate: false});
|
||||
}
|
||||
gBrowser.selectedBrowser.loadURI("about:blank");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank", {
|
||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
|
||||
});
|
||||
await promiseRemoveEngine();
|
||||
});
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ function test() {
|
|||
// load about:home, but remove the listener first so it doesn't
|
||||
// get in the way
|
||||
gBrowser.removeProgressListener(listener);
|
||||
gBrowser.loadURI("about:home");
|
||||
BrowserTestUtils.loadURI(gBrowser, "about:home");
|
||||
info("Waiting for about:home load");
|
||||
tab.linkedBrowser.addEventListener("load", function load(event) {
|
||||
if (event.originalTarget != tab.linkedBrowser.contentDocumentAsCPOW ||
|
||||
|
|
|
@ -16,7 +16,7 @@ const TESTS = [
|
|||
function promiseTestOpenCloseWindow(aIsPrivate, aTest) {
|
||||
return (async function() {
|
||||
let win = await BrowserTestUtils.openNewBrowserWindow({ "private": aIsPrivate });
|
||||
win.gBrowser.selectedBrowser.loadURI(aTest.url);
|
||||
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, aTest.url);
|
||||
await promiseBrowserLoaded(win.gBrowser.selectedBrowser, true, aTest.url);
|
||||
// Mark the window with some unique data to be restored later on.
|
||||
ss.setWindowValue(win, aTest.key, aTest.value);
|
||||
|
|
|
@ -33,7 +33,7 @@ add_task(async function() {
|
|||
],
|
||||
});
|
||||
|
||||
browser.loadURI("about:sessionrestore");
|
||||
BrowserTestUtils.loadURI(browser, "about:sessionrestore");
|
||||
await BrowserTestUtils.browserLoaded(browser, false, "about:sessionrestore");
|
||||
doc = browser.contentDocument;
|
||||
|
||||
|
|
|
@ -17,7 +17,10 @@ add_task(async function() {
|
|||
|
||||
// Load a new URI with a specific referrer.
|
||||
let referrerURI = Services.io.newURI(REFERRER1);
|
||||
browser.loadURI("http://example.org", { referrerURI });
|
||||
browser.loadURI("http://example.org", {
|
||||
referrerURI,
|
||||
triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({}),
|
||||
});
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
|
|
@ -97,7 +97,7 @@ add_task(async function test_remove_uninteresting_window() {
|
|||
// site.
|
||||
let tab = newWin.gBrowser.selectedTab;
|
||||
let browser = tab.linkedBrowser;
|
||||
browser.loadURI(PAGE);
|
||||
BrowserTestUtils.loadURI(browser, PAGE);
|
||||
|
||||
await BrowserTestUtils.browserLoaded(browser, false, PAGE);
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
@ -157,7 +157,7 @@ add_task(async function test_synchronously_remove_window_state() {
|
|||
// interesting.
|
||||
let newWin = await BrowserTestUtils.openNewBrowserWindow();
|
||||
let browser = newWin.gBrowser.selectedBrowser;
|
||||
browser.loadURI(PAGE);
|
||||
BrowserTestUtils.loadURI(browser, PAGE);
|
||||
await BrowserTestUtils.browserLoaded(browser, false, PAGE);
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ async function setupBackgroundTabs(testFn) {
|
|||
// foreground.
|
||||
let initialTab = gBrowser.selectedTab;
|
||||
let initialBrowser = initialTab.linkedBrowser;
|
||||
initialBrowser.loadURI(NON_REMOTE_PAGE);
|
||||
BrowserTestUtils.loadURI(initialBrowser, NON_REMOTE_PAGE);
|
||||
await BrowserTestUtils.browserLoaded(initialBrowser);
|
||||
|
||||
// Open some tabs that should be running in the content process.
|
||||
|
|
|
@ -73,7 +73,7 @@ add_task(async function test_creation() {
|
|||
// Open a second tab, save session, ensure that the correct files exist.
|
||||
info("Testing situation after a second write");
|
||||
let URL2 = URL_BASE + "?second_write";
|
||||
tab.linkedBrowser.loadURI(URL2);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, URL2);
|
||||
await promiseBrowserLoaded(tab.linkedBrowser);
|
||||
await TabStateFlusher.flush(tab.linkedBrowser);
|
||||
await SessionSaver.run();
|
||||
|
|
|
@ -120,7 +120,7 @@ async function createTabWithStorageData(urls, win = window) {
|
|||
let browser = tab.linkedBrowser;
|
||||
|
||||
for (let url of urls) {
|
||||
browser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(browser, url);
|
||||
await promiseBrowserLoaded(browser);
|
||||
await modifySessionStorage(browser, {test: INITIAL_VALUE});
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ let notificationsCount = 0;
|
|||
async function openWindow(url) {
|
||||
let win = await promiseNewWindowLoaded();
|
||||
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
|
||||
win.gBrowser.selectedBrowser.loadURI(url, { flags });
|
||||
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, url, { flags });
|
||||
await promiseBrowserLoaded(win.gBrowser.selectedBrowser, true, url);
|
||||
return win;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ let notificationsCount = 0;
|
|||
async function openWindow(url) {
|
||||
let win = await promiseNewWindowLoaded();
|
||||
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
|
||||
win.gBrowser.selectedBrowser.loadURI(url, { flags });
|
||||
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, url, { flags });
|
||||
await promiseBrowserLoaded(win.gBrowser.selectedBrowser, true, url);
|
||||
return win;
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ add_task(async function test_crash_page_not_in_history() {
|
|||
ok(browser.isRemoteBrowser, "Should be a remote browser");
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
browser.loadURI(PAGE_1);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_1);
|
||||
await promiseBrowserLoaded(browser);
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
||||
|
@ -163,7 +163,7 @@ add_task(async function test_revived_history_from_remote() {
|
|||
ok(browser.isRemoteBrowser, "Should be a remote browser");
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
browser.loadURI(PAGE_1);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_1);
|
||||
await promiseBrowserLoaded(browser);
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
||||
|
@ -172,7 +172,7 @@ add_task(async function test_revived_history_from_remote() {
|
|||
|
||||
// Browse to a new site that will cause the browser to
|
||||
// become remote again.
|
||||
browser.loadURI(PAGE_2);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_2);
|
||||
await promiseTabRestored(newTab);
|
||||
ok(!newTab.hasAttribute("crashed"), "Tab shouldn't be marked as crashed anymore.");
|
||||
ok(browser.isRemoteBrowser, "Should be a remote browser");
|
||||
|
@ -202,7 +202,7 @@ add_task(async function test_revived_history_from_non_remote() {
|
|||
ok(browser.isRemoteBrowser, "Should be a remote browser");
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
browser.loadURI(PAGE_1);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_1);
|
||||
await promiseBrowserLoaded(browser);
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
||||
|
@ -211,7 +211,7 @@ add_task(async function test_revived_history_from_non_remote() {
|
|||
|
||||
// Browse to a new site that will not cause the browser to
|
||||
// become remote again.
|
||||
browser.loadURI("about:mozilla");
|
||||
BrowserTestUtils.loadURI(browser, "about:mozilla");
|
||||
await promiseBrowserLoaded(browser);
|
||||
ok(!newTab.hasAttribute("crashed"), "Tab shouldn't be marked as crashed anymore.");
|
||||
ok(!browser.isRemoteBrowser, "Should not be a remote browser");
|
||||
|
@ -240,7 +240,7 @@ add_task(async function test_revive_tab_from_session_store() {
|
|||
ok(browser.isRemoteBrowser, "Should be a remote browser");
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
browser.loadURI(PAGE_1);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_1);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
let newTab2 = BrowserTestUtils.addTab(gBrowser, "about:blank", { sameProcessAsFrameLoader: browser.frameLoader });
|
||||
|
@ -248,10 +248,10 @@ add_task(async function test_revive_tab_from_session_store() {
|
|||
ok(browser2.isRemoteBrowser, "Should be a remote browser");
|
||||
await promiseBrowserLoaded(browser2);
|
||||
|
||||
browser.loadURI(PAGE_1);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_1);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
browser.loadURI(PAGE_2);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_2);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
@ -293,7 +293,7 @@ add_task(async function test_revive_all_tabs_from_session_store() {
|
|||
ok(browser.isRemoteBrowser, "Should be a remote browser");
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
browser.loadURI(PAGE_1);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_1);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
// In order to see a second about:tabcrashed page, we'll need
|
||||
|
@ -306,10 +306,10 @@ add_task(async function test_revive_all_tabs_from_session_store() {
|
|||
ok(browser2.isRemoteBrowser, "Should be a remote browser");
|
||||
await promiseBrowserLoaded(browser2);
|
||||
|
||||
browser.loadURI(PAGE_1);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_1);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
browser.loadURI(PAGE_2);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_2);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
@ -353,7 +353,7 @@ add_task(async function test_close_tab_after_crash() {
|
|||
ok(browser.isRemoteBrowser, "Should be a remote browser");
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
browser.loadURI(PAGE_1);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_1);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
@ -382,7 +382,7 @@ add_task(async function test_hide_restore_all_button() {
|
|||
ok(browser.isRemoteBrowser, "Should be a remote browser");
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
browser.loadURI(PAGE_1);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_1);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
@ -401,7 +401,7 @@ add_task(async function test_hide_restore_all_button() {
|
|||
let newTab2 = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedTab = newTab;
|
||||
|
||||
browser.loadURI(PAGE_2);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_2);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
// Load up a second window so we can get another tab to show
|
||||
|
@ -440,7 +440,7 @@ add_task(async function test_aboutcrashedtabzoom() {
|
|||
ok(browser.isRemoteBrowser, "Should be a remote browser");
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
browser.loadURI(PAGE_1);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_1);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
FullZoom.enlarge();
|
||||
|
|
|
@ -12,7 +12,7 @@ add_task(async function test() {
|
|||
|
||||
// Load some URL in the current tab.
|
||||
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
|
||||
win.gBrowser.selectedBrowser.loadURI("about:robots", { flags });
|
||||
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, "about:robots", { flags });
|
||||
await promiseBrowserLoaded(win.gBrowser.selectedBrowser);
|
||||
|
||||
// Open a second tab and close the first one.
|
||||
|
|
|
@ -78,7 +78,7 @@ let forgetWinHelper = async function(forgetFn) {
|
|||
// Create a tab worth remembering.
|
||||
let tab = newWin.gBrowser.selectedTab;
|
||||
let browser = tab.linkedBrowser;
|
||||
browser.loadURI(PAGE);
|
||||
BrowserTestUtils.loadURI(browser, PAGE);
|
||||
await BrowserTestUtils.browserLoaded(browser, false, PAGE);
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ add_task(async function test_frametree() {
|
|||
is(await countNonDynamicFrames(browser), 0, "no child frames");
|
||||
|
||||
// Navigate to a frameset.
|
||||
browser.loadURI(URL_FRAMESET);
|
||||
BrowserTestUtils.loadURI(browser, URL_FRAMESET);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
// The frameset has two frames.
|
||||
|
|
|
@ -34,7 +34,7 @@ add_task(async function check_history_not_persisted() {
|
|||
});
|
||||
|
||||
// Load a new URL into the tab, it should replace the about:blank history entry
|
||||
browser.loadURI("about:robots");
|
||||
BrowserTestUtils.loadURI(browser, "about:robots");
|
||||
await promiseBrowserLoaded(browser);
|
||||
await ContentTask.spawn(browser, null, function() {
|
||||
let sessionHistory = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
|
@ -77,7 +77,7 @@ add_task(async function check_history_default_persisted() {
|
|||
});
|
||||
|
||||
// Load a new URL into the tab, it should replace the about:blank history entry
|
||||
browser.loadURI("about:robots");
|
||||
BrowserTestUtils.loadURI(browser, "about:robots");
|
||||
await promiseBrowserLoaded(browser);
|
||||
await ContentTask.spawn(browser, null, function() {
|
||||
let sessionHistory = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
|
|
|
@ -13,9 +13,9 @@ add_task(async function() {
|
|||
ok(!browser.isRemoteBrowser, "Ensure browser is not remote");
|
||||
// Load a remote page, and then another remote page immediately
|
||||
// after.
|
||||
browser.loadURI(PAGE_1);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_1);
|
||||
browser.stop();
|
||||
browser.loadURI(PAGE_2);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_2);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
ok(browser.isRemoteBrowser, "Should have switched remoteness");
|
||||
|
|
|
@ -22,7 +22,7 @@ add_task(async function() {
|
|||
tab2 = BrowserTestUtils.addTab(gBrowser);
|
||||
await promiseBrowserLoaded(tab2.linkedBrowser);
|
||||
await setUsePrivateBrowsing(tab2.linkedBrowser, true);
|
||||
tab2.linkedBrowser.loadURI(URL_PRIVATE);
|
||||
BrowserTestUtils.loadURI(tab2.linkedBrowser, URL_PRIVATE);
|
||||
await promiseBrowserLoaded(tab2.linkedBrowser);
|
||||
|
||||
info("Flush to make sure chrome received all data.");
|
||||
|
|
|
@ -32,6 +32,8 @@ var testSwitchToTab = async function(url, options) {
|
|||
ok(tab.hasAttribute("pending"), "tab is pending");
|
||||
await promise;
|
||||
|
||||
options.triggeringPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||
|
||||
// Switch-to-tab with a similar URI.
|
||||
switchToTabHavingURI(url, false, options);
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ add_task(async function test_scroll_background_tabs() {
|
|||
await checkScroll(tab, {scroll: SCROLL_STR}, "scroll on first page is fine");
|
||||
|
||||
// Navigate to a different page and scroll there as well.
|
||||
browser.loadURI(URL2);
|
||||
BrowserTestUtils.loadURI(browser, URL2);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
// Scroll down a little.
|
||||
|
|
|
@ -76,7 +76,7 @@ add_task(async function test_pageshow() {
|
|||
await promiseBrowserLoaded(browser);
|
||||
|
||||
// Create a second shistory entry.
|
||||
browser.loadURI(URL2);
|
||||
BrowserTestUtils.loadURI(browser, URL2);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
// Wait until shistory changes.
|
||||
|
@ -164,7 +164,7 @@ add_task(async function test_about_page_navigate() {
|
|||
// Verify that the title is also recorded.
|
||||
is(entries[0].title, "about:blank", "title is correct");
|
||||
|
||||
browser.loadURI("about:robots");
|
||||
BrowserTestUtils.loadURI(browser, "about:robots");
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
// Check that we have changed the history entry.
|
||||
|
|
|
@ -76,7 +76,7 @@ add_task(async function session_storage() {
|
|||
"sessionStorage data for mochi.test has been duplicated correctly");
|
||||
|
||||
// Check that loading a new URL discards data.
|
||||
browser2.loadURI("http://mochi.test:8888/");
|
||||
BrowserTestUtils.loadURI(browser2, "http://mochi.test:8888/");
|
||||
await promiseBrowserLoaded(browser2);
|
||||
await TabStateFlusher.flush(browser2);
|
||||
|
||||
|
@ -86,7 +86,7 @@ add_task(async function session_storage() {
|
|||
ok(!storage["http://example.com"], "storage data was discarded");
|
||||
|
||||
// Check that loading a new URL discards data.
|
||||
browser2.loadURI("about:mozilla");
|
||||
BrowserTestUtils.loadURI(browser2, "about:mozilla");
|
||||
await promiseBrowserLoaded(browser2);
|
||||
await TabStateFlusher.flush(browser2);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ add_task(async function() {
|
|||
|
||||
// Load more pages than we would save to disk on a clean shutdown.
|
||||
for (let i = 0; i < MAX_BACK + 2; i++) {
|
||||
browser.loadURI(URL + i);
|
||||
BrowserTestUtils.loadURI(browser, URL + i);
|
||||
await promiseBrowserLoaded(browser);
|
||||
ok(browser.isRemoteBrowser, "browser is still remote");
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ add_task(async function() {
|
|||
await countHistoryEntries(browser, MAX_BACK + 2);
|
||||
|
||||
// Load a non-remote page.
|
||||
browser.loadURI("about:robots");
|
||||
BrowserTestUtils.loadURI(browser, "about:robots");
|
||||
await promiseTabRestored(tab);
|
||||
ok(!browser.isRemoteBrowser, "browser is not remote anymore");
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ async function openAndCloseTab(window, url) {
|
|||
async function openWindow(url) {
|
||||
let win = await promiseNewWindowLoaded();
|
||||
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
|
||||
win.gBrowser.selectedBrowser.loadURI(url, { flags });
|
||||
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, url, { flags });
|
||||
await promiseBrowserLoaded(win.gBrowser.selectedBrowser, true, url);
|
||||
return win;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ function onPageLoad() {
|
|||
function test() {
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(onPageLoad, false, "about:logo");
|
||||
gBrowser.loadURI("about:logo");
|
||||
BrowserTestUtils.loadURI(gBrowser, "about:logo");
|
||||
|
||||
waitForExplicitFinish();
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ function test() {
|
|||
});
|
||||
});
|
||||
|
||||
gBrowser.selectedBrowser.loadURI("http://example.com/");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "http://example.com/");
|
||||
}
|
||||
|
||||
function getLanguageExceptions() {
|
||||
|
|
|
@ -88,7 +88,7 @@ function test() {
|
|||
});
|
||||
});
|
||||
|
||||
gBrowser.selectedBrowser.loadURI("data:text/plain,test page");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "data:text/plain,test page");
|
||||
}
|
||||
|
||||
function checkURLBarIcon(aExpectTranslated = false) {
|
||||
|
|
|
@ -37,14 +37,14 @@ add_task(async function testTemporaryPermissionTabURLs() {
|
|||
await BrowserTestUtils.withNewTab("about:blank", async function(browser) {
|
||||
for (let uri of same) {
|
||||
let loaded = BrowserTestUtils.browserLoaded(browser, false, uri.spec);
|
||||
browser.loadURI(uri.spec);
|
||||
BrowserTestUtils.loadURI(browser, uri.spec);
|
||||
await loaded;
|
||||
|
||||
SitePermissions.set(uri, id, SitePermissions.BLOCK, SitePermissions.SCOPE_TEMPORARY, browser);
|
||||
|
||||
for (let uri2 of same) {
|
||||
let loaded2 = BrowserTestUtils.browserLoaded(browser, false, uri2.spec);
|
||||
browser.loadURI(uri2.spec);
|
||||
BrowserTestUtils.loadURI(browser, uri2.spec);
|
||||
await loaded2;
|
||||
|
||||
Assert.deepEqual(SitePermissions.get(uri2, id, browser), {
|
||||
|
@ -58,7 +58,7 @@ add_task(async function testTemporaryPermissionTabURLs() {
|
|||
|
||||
for (let uri of different) {
|
||||
let loaded = BrowserTestUtils.browserLoaded(browser, false, uri.spec);
|
||||
browser.loadURI(uri.spec);
|
||||
BrowserTestUtils.loadURI(browser, uri.spec);
|
||||
await loaded;
|
||||
|
||||
SitePermissions.set(uri, id, SitePermissions.BLOCK, SitePermissions.SCOPE_TEMPORARY, browser);
|
||||
|
@ -70,7 +70,7 @@ add_task(async function testTemporaryPermissionTabURLs() {
|
|||
|
||||
for (let uri2 of different) {
|
||||
loaded = BrowserTestUtils.browserLoaded(browser, false, uri2.spec);
|
||||
browser.loadURI(uri2.spec);
|
||||
BrowserTestUtils.loadURI(browser, uri2.spec);
|
||||
await loaded;
|
||||
|
||||
if (uri2 != uri) {
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче