зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1485305 - dom/ Ensure loadURI always passes a triggeringPrincipal() r=Nika
Differential Revision: https://phabricator.services.mozilla.com/D4557 --HG-- extra : source : b55b6968de5a1c12e459a4e07a69ca5f46e5b1a1
This commit is contained in:
Родитель
b40ee11ead
Коммит
c9dd3d1bdb
|
@ -54,7 +54,7 @@ add_task(async function(){
|
|||
is(ppmm.childCount, originalChildCount, "Preloaded browser should (still) not create a new content process.")
|
||||
|
||||
// Navigate to a content page from the parent side.
|
||||
tab2.linkedBrowser.loadURI(TEST_URL);
|
||||
BrowserTestUtils.loadURI(tab2.linkedBrowser, TEST_URL);
|
||||
await BrowserTestUtils.browserLoaded(tab2.linkedBrowser, false, TEST_URL);
|
||||
is(ppmm.childCount, originalChildCount + 1,
|
||||
"Navigating away from the preloaded browser (parent side) should create a new content process.")
|
||||
|
@ -97,7 +97,7 @@ add_task(async function preloaded_state_attribute() {
|
|||
is(preloadedTabState, PRELOADED_STATE, "The preloaded browser has the correct attribute");
|
||||
|
||||
// Navigate away and check that the attribute has been removed altogether
|
||||
gBrowser.selectedBrowser.loadURI(TEST_URL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URL);
|
||||
let navigatedTabHasState = gBrowser.selectedBrowser.hasAttribute("preloadedState");
|
||||
ok(!navigatedTabHasState, "Correctly removed the preloadState attribute when navigating away");
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ add_task(async function mixed_content_block_for_target_top_test() {
|
|||
let loadPromise = BrowserTestUtils.browserLoaded(testBrowser, false, url);
|
||||
let frameLoadPromise = BrowserTestUtils.browserLoaded(testBrowser, true,
|
||||
frameUrl);
|
||||
testBrowser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(testBrowser, url);
|
||||
await loadPromise;
|
||||
await frameLoadPromise;
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ add_task(async function() {
|
|||
checkBaseProcessCount("Should still be at the base number of processes at this point");
|
||||
|
||||
// Load something in the main process
|
||||
gBrowser.selectedBrowser.loadURI("about:robots");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:robots");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
let init = Services.ppmm.initialProcessData;
|
||||
|
@ -146,7 +146,7 @@ add_task(async function() {
|
|||
check = checkProcess(Services.ppmm);
|
||||
// Reset the default browser to start a new child process
|
||||
gBrowser.updateBrowserRemoteness(gBrowser.selectedBrowser, true);
|
||||
gBrowser.selectedBrowser.loadURI("about:blank");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, "about:blank");
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
||||
checkBaseProcessCount("Should be back to the base number of processes at this point");
|
||||
|
|
|
@ -106,7 +106,7 @@ const test = Test(async function() {
|
|||
pageShown = receive("content-page-shown", isData);
|
||||
let pageHidden = receive("content-page-hidden", isData);
|
||||
|
||||
browser1.loadURI(uri2);
|
||||
BrowserTestUtils.loadURI(browser1, uri2);
|
||||
|
||||
let hiddenPage = await pageHidden;
|
||||
is(interactiveDocument1, hiddenPage, "loaded document is hidden");
|
||||
|
@ -140,7 +140,7 @@ const test = Test(async function() {
|
|||
|
||||
info("load uri#3");
|
||||
|
||||
browser1.loadURI(uri3);
|
||||
BrowserTestUtils.loadURI(browser1, uri3);
|
||||
|
||||
pageShown = receive("content-page-shown", isData);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ async function runTest(url) {
|
|||
|
||||
// Wait for the UI to indicate that audio is being played back.
|
||||
let promise = BrowserTestUtils.waitForAttribute("soundplaying", newTab, "true");
|
||||
newBrowser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(newBrowser, url);
|
||||
await promise;
|
||||
|
||||
// Put the tab in the background.
|
||||
|
|
|
@ -143,7 +143,7 @@ var check_use_counter_iframe = async function(file, use_counter_middlefix, check
|
|||
histogram_docs_before, histogram_toplevel_docs_before] =
|
||||
await grabHistogramsFromContent(use_counter_middlefix);
|
||||
|
||||
gBrowser.selectedBrowser.loadURI(gHttpTestRoot + "file_use_counter_outer.html");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, gHttpTestRoot + "file_use_counter_outer.html");
|
||||
await waitForPageLoad(gBrowser.selectedBrowser);
|
||||
|
||||
// Inject our desired file into the iframe of the newly-loaded page.
|
||||
|
@ -207,7 +207,7 @@ var check_use_counter_img = async function(file, use_counter_middlefix) {
|
|||
histogram_docs_before, histogram_toplevel_docs_before] =
|
||||
await grabHistogramsFromContent(use_counter_middlefix);
|
||||
|
||||
gBrowser.selectedBrowser.loadURI(gHttpTestRoot + "file_use_counter_outer.html");
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, gHttpTestRoot + "file_use_counter_outer.html");
|
||||
await waitForPageLoad(gBrowser.selectedBrowser);
|
||||
|
||||
// Inject our desired file into the img of the newly-loaded page.
|
||||
|
@ -273,7 +273,7 @@ var check_use_counter_direct = async function(file, use_counter_middlefix, xfail
|
|||
histogram_docs_before, histogram_toplevel_docs_before] =
|
||||
await grabHistogramsFromContent(use_counter_middlefix);
|
||||
|
||||
gBrowser.selectedBrowser.loadURI(gHttpTestRoot + file);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, gHttpTestRoot + file);
|
||||
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
|
||||
ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm");
|
||||
await new Promise(resolve => {
|
||||
|
|
|
@ -20,6 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=415498
|
|||
|
||||
<pre id="test">
|
||||
<script class="testbody" type="application/javascript"><![CDATA[
|
||||
ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
|
||||
/** Test for Bug 415498 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
@ -64,7 +65,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=415498
|
|||
|
||||
// 1) This document uses addEventListener to register a method throwing an exception
|
||||
var chromeDir = getRootDirectory(window.location.href);
|
||||
browser.loadURI(chromeDir + "bug415498-doc1.html");
|
||||
BrowserTestUtils.loadURI(browser, chromeDir + "bug415498-doc1.html");
|
||||
yield undefined;
|
||||
|
||||
ok(verifyErrorReceived("HierarchyRequestError"),
|
||||
|
@ -73,7 +74,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=415498
|
|||
|
||||
// 2) This document sets window.onload to register a method throwing an exception
|
||||
var chromeDir = getRootDirectory(window.location.href);
|
||||
browser.loadURI(chromeDir + "bug415498-doc2.html");
|
||||
BrowserTestUtils.loadURI(browser, chromeDir + "bug415498-doc2.html");
|
||||
yield undefined;
|
||||
|
||||
ok(verifyErrorReceived("HierarchyRequestError"),
|
||||
|
|
|
@ -17,6 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=617528
|
|||
</body>
|
||||
|
||||
<script type="application/javascript"><![CDATA[
|
||||
ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
var _window;
|
||||
var browser;
|
||||
|
||||
|
@ -39,7 +40,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=617528
|
|||
</div>\
|
||||
</body>\
|
||||
</html>';
|
||||
browser.loadURI(uri);
|
||||
BrowserTestUtils.loadURI(browser, uri);
|
||||
}
|
||||
|
||||
function onPageShow() {
|
||||
|
|
|
@ -16,7 +16,7 @@ add_task(async function() {
|
|||
return deferred.promise;
|
||||
});
|
||||
|
||||
tab.linkedBrowser.loadURI(uri);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, uri);
|
||||
let loadedURI = await eventPromise;
|
||||
is(loadedURI, uri, "Should have seen the event for the right URI");
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ add_task(async function test1() {
|
|||
|
||||
// Set database version for domain 1
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL1);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL1);
|
||||
await waitForMessage(11, gBrowser);
|
||||
gBrowser.removeCurrentTab();
|
||||
});
|
||||
|
@ -34,7 +34,7 @@ add_task(async function test1() {
|
|||
add_task(async function test2() {
|
||||
// Set database version for domain 2
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL2);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL2);
|
||||
await waitForMessage(11, gBrowser);
|
||||
gBrowser.removeCurrentTab();
|
||||
});
|
||||
|
@ -49,7 +49,7 @@ add_task(async function test3() {
|
|||
add_task(async function test4() {
|
||||
// Get database version for domain 1
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL3);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL3);
|
||||
await waitForMessage(11, gBrowser);
|
||||
gBrowser.removeCurrentTab();
|
||||
});
|
||||
|
@ -57,7 +57,7 @@ add_task(async function test4() {
|
|||
add_task(async function test5() {
|
||||
// Get database version for domain 2
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL4);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL4);
|
||||
await waitForMessage(1, gBrowser);
|
||||
gBrowser.removeCurrentTab();
|
||||
});
|
||||
|
|
|
@ -26,7 +26,7 @@ add_task(async function test1() {
|
|||
});
|
||||
|
||||
info("loading test page: " + testPageURL);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL);
|
||||
|
||||
await waitForMessage(true, gBrowser);
|
||||
is(getPermission(testPageURL, "indexedDB"),
|
||||
|
@ -50,7 +50,7 @@ add_task(async function test2() {
|
|||
});
|
||||
|
||||
info("loading test page: " + testPageURL);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL);
|
||||
|
||||
await waitForMessage(true, gBrowser);
|
||||
is(getPermission(testPageURL, "indexedDB"),
|
||||
|
|
|
@ -25,7 +25,7 @@ add_task(async function test1() {
|
|||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
info("loading test page: " + testPageURL);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL);
|
||||
await waitForMessage("InvalidStateError", gBrowser);
|
||||
|
||||
is(getPermission(testPageURL, "indexedDB"),
|
||||
|
@ -52,7 +52,7 @@ add_task(async function test2() {
|
|||
win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser);
|
||||
|
||||
info("loading test page: " + testPageURL);
|
||||
win.gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, testPageURL);
|
||||
await waitForMessage("InvalidStateError", win.gBrowser);
|
||||
|
||||
is(getPermission(testPageURL, "indexedDB"),
|
||||
|
@ -78,7 +78,7 @@ add_task(async function test3() {
|
|||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
info("loading test page: " + testPageURL);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL);
|
||||
await waitForMessage("InvalidStateError", gBrowser);
|
||||
|
||||
is(getPermission(testPageURL, "indexedDB"),
|
||||
|
|
|
@ -26,7 +26,7 @@ add_task(async function test1() {
|
|||
info("creating tab");
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
info("loading test page: " + testWorkerURL);
|
||||
gBrowser.selectedBrowser.loadURI(testWorkerURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testWorkerURL);
|
||||
|
||||
await waitForMessage("ok", gBrowser);
|
||||
is(getPermission(testWorkerURL, "indexedDB"),
|
||||
|
@ -54,7 +54,7 @@ add_task(async function test2() {
|
|||
|
||||
|
||||
info("loading test page: " + testSharedWorkerURL);
|
||||
gBrowser.selectedBrowser.loadURI(testSharedWorkerURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testSharedWorkerURL);
|
||||
await waitForMessage("InvalidStateError", gBrowser);
|
||||
is(getPermission(testSharedWorkerURL, "indexedDB"),
|
||||
Ci.nsIPermissionManager.UNKNOWN_ACTION,
|
||||
|
|
|
@ -15,7 +15,7 @@ add_task(async function test1() {
|
|||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
info("loading test page: " + testPageURL);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL);
|
||||
|
||||
await waitForMessage(true, gBrowser);
|
||||
gBrowser.removeCurrentTab();
|
||||
|
@ -27,7 +27,7 @@ add_task(async function test2() {
|
|||
|
||||
info("creating tab");
|
||||
win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser);
|
||||
win.gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, testPageURL);
|
||||
await waitForMessage("InvalidStateError", win.gBrowser);
|
||||
win.gBrowser.removeCurrentTab();
|
||||
await BrowserTestUtils.closeWindow(win);
|
||||
|
|
|
@ -49,7 +49,7 @@ async function test_domainPolicy() {
|
|||
|
||||
return loadBase();
|
||||
});
|
||||
tab.linkedBrowser.loadURI("http://mochi.test:8888/browser/dom/ipc/tests/file_domainPolicy_base.html");
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, "http://mochi.test:8888/browser/dom/ipc/tests/file_domainPolicy_base.html");
|
||||
return initPromise;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ add_task(async function() {
|
|||
});
|
||||
|
||||
let promise = BrowserTestUtils.browserLoaded(browser);
|
||||
browser.loadURI(gTestRoot + "plugin_test.html");
|
||||
BrowserTestUtils.loadURI(browser, gTestRoot + "plugin_test.html");
|
||||
await promise;
|
||||
|
||||
await ContentTask.spawn(browser, null, async function() {
|
||||
|
@ -50,7 +50,7 @@ add_task(async function() {
|
|||
// be wrapped in jar:, but that shouldn't matter for this test
|
||||
promise = BrowserTestUtils.browserLoaded(browser);
|
||||
let converteduri = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry).convertChromeURL(Services.io.newURI(rootDir + "plugin_test.html"));
|
||||
browser.loadURI(converteduri.spec);
|
||||
BrowserTestUtils.loadURI(browser, converteduri.spec);
|
||||
await promise;
|
||||
|
||||
await ContentTask.spawn(browser, null, async function() {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
<![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
@ -59,14 +60,14 @@ function runTestsCallback() {
|
|||
whenDelayedStartupFinished(win, function () {
|
||||
win.addEventListener("DOMContentLoaded", function onInnerLoad() {
|
||||
if (win.content.location.href == "about:privatebrowsing") {
|
||||
win.gBrowser.loadURI(contentPage);
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage)
|
||||
return;
|
||||
}
|
||||
win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
|
||||
win.gBrowser.selectedBrowser.focus();
|
||||
SimpleTest.executeSoon(function() { aCallback(win); });
|
||||
}, true);
|
||||
SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
|
||||
SimpleTest.executeSoon(function() { BrowserTestUtils.loadURI(win.gBrowser, contentPage); });
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ add_task(async function testPermissionAllow() {
|
|||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
info("Loading test page: " + testPageURL);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL);
|
||||
await waitForMessage(true, gBrowser);
|
||||
|
||||
is(getPermission(testPageURL, "persistent-storage"),
|
||||
|
@ -50,7 +50,7 @@ add_task(async function testNoPermissionPrompt() {
|
|||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
info("Loading test page: " + testPageURL);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL);
|
||||
await waitForMessage(true, gBrowser);
|
||||
|
||||
is(getPermission(testPageURL, "persistent-storage"),
|
||||
|
|
|
@ -24,7 +24,7 @@ add_task(async function testPermissionDenied() {
|
|||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
info("Loading test page: " + testPageURL);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL);
|
||||
await waitForMessage(false, gBrowser);
|
||||
|
||||
is(getPermission(testPageURL, "persistent-storage"),
|
||||
|
@ -50,7 +50,7 @@ add_task(async function testNoPermissionPrompt() {
|
|||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
info("Loading test page: " + testPageURL);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL);
|
||||
await waitForMessage(false, gBrowser);
|
||||
|
||||
is(getPermission(testPageURL, "persistent-storage"),
|
||||
|
@ -78,7 +78,7 @@ add_task(async function testPermissionDeniedDismiss() {
|
|||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
|
||||
|
||||
info("Loading test page: " + testPageURL);
|
||||
gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, testPageURL);
|
||||
await waitForMessage(false, gBrowser);
|
||||
|
||||
// Pressing ESC results in a temporary block permission on the browser object.
|
||||
|
|
|
@ -25,7 +25,7 @@ add_task(async function testPermissionUnknownInPrivateWindow() {
|
|||
win.gBrowser.selectedTab = BrowserTestUtils.addTab(win.gBrowser);
|
||||
|
||||
info("Loading test page: " + testPageURL);
|
||||
win.gBrowser.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, testPageURL);
|
||||
await waitForMessage(false, win.gBrowser);
|
||||
|
||||
is(getPermission(testPageURL, "persistent-storage"),
|
||||
|
|
|
@ -31,5 +31,5 @@ function test() {
|
|||
win.close();
|
||||
finish();
|
||||
});
|
||||
gBrowser.loadURI(kTestURI);
|
||||
BrowserTestUtils.loadURI(gBrowser, kTestURI);
|
||||
}
|
||||
|
|
|
@ -31,5 +31,5 @@ function test() {
|
|||
win.close();
|
||||
finish();
|
||||
});
|
||||
gBrowser.loadURI(kTestURI);
|
||||
BrowserTestUtils.loadURI(gBrowser, kTestURI);
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ function test() {
|
|||
|
||||
return downloadList.addView(downloadListener);
|
||||
}).then(function() {
|
||||
gBrowser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(gBrowser, url);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ function test() {
|
|||
gBrowser.selectedTab = tab;
|
||||
|
||||
tab.linkedBrowser.messageManager.loadFrameScript("data:,(" + encodeURIComponent(frameScript) + ")()", true);
|
||||
gBrowser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(gBrowser, url);
|
||||
|
||||
async function done() {
|
||||
tab.linkedBrowser.messageManager.removeMessageListener("test:event", eventHandler);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<body>
|
||||
|
||||
<script type="application/javascript">
|
||||
ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
|
||||
var mainWindow;
|
||||
|
||||
|
@ -19,7 +20,7 @@ function testOnWindow(aIsPrivate, aCallback) {
|
|||
win.addEventListener("load", function() {
|
||||
win.addEventListener("DOMContentLoaded", function onInnerLoad() {
|
||||
if (win.content.location.href != contentPage) {
|
||||
win.gBrowser.loadURI(contentPage);
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -28,7 +29,7 @@ function testOnWindow(aIsPrivate, aCallback) {
|
|||
}, true);
|
||||
|
||||
if (!aIsPrivate) {
|
||||
win.gBrowser.loadURI(contentPage);
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
|
||||
}
|
||||
}, {capture: true, once: true});
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ function test() {
|
|||
storageShouldOccur = true;
|
||||
innerID = getInnerWindowId(aWindow);
|
||||
beforeEvents = ConsoleAPIStorage.getEvents(innerID);
|
||||
aWindow.gBrowser.selectedBrowser.loadURI(testURI);
|
||||
BrowserTestUtils.loadURI(aWindow.gBrowser.selectedBrowser, testURI);
|
||||
}
|
||||
|
||||
function testOnWindow(aOptions, aCallback) {
|
||||
|
|
|
@ -13,7 +13,7 @@ add_task(async function() {
|
|||
|
||||
// Load the second tab in the background.
|
||||
let loadedPromise = BrowserTestUtils.browserLoaded(tabs[1].linkedBrowser);
|
||||
tabs[1].linkedBrowser.loadURI(testingList[0].uri);
|
||||
BrowserTestUtils.loadURI(tabs[1].linkedBrowser, testingList[0].uri);
|
||||
await loadedPromise;
|
||||
|
||||
for (var i = 0; i < testingList.length; ++i) {
|
||||
|
|
|
@ -4,7 +4,7 @@ add_task(async function() {
|
|||
const url = "data:text/html,<!DOCTYPE html><html><body><input autofocus><button autofocus></button><textarea autofocus></textarea><select autofocus></select></body></html>";
|
||||
|
||||
let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
gBrowser.selectedBrowser.loadURI(url);
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
|
||||
await loadedPromise;
|
||||
|
||||
await new Promise(resolve => executeSoon(resolve));
|
||||
|
|
|
@ -56,7 +56,7 @@ add_task(async function() {
|
|||
let browserTest = winTest.gBrowser;
|
||||
|
||||
info(`loading test page: ${testPageURL}`);
|
||||
browserTest.selectedBrowser.loadURI(testPageURL);
|
||||
BrowserTestUtils.loadURI(browserTest.selectedBrowser, testPageURL);
|
||||
await BrowserTestUtils.browserLoaded(browserTest.selectedBrowser);
|
||||
|
||||
info("test init visibility state");
|
||||
|
|
|
@ -430,7 +430,7 @@ add_task(async function test_inner_window_scenarios() {
|
|||
|
||||
// Now send the page back to the test page for
|
||||
// the next few tests.
|
||||
browser.loadURI(PAGE_URL);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_URL);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
// We want to test hasBeforeUnload works properly with
|
||||
|
@ -634,7 +634,7 @@ add_task(async function test_outer_window_scenarios() {
|
|||
|
||||
// Now send the page back to the test page for
|
||||
// the next few tests.
|
||||
browser.loadURI(PAGE_URL);
|
||||
BrowserTestUtils.loadURI(browser, PAGE_URL);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
// We should initially start with hasBeforeUnload set to false.
|
||||
|
|
|
@ -54,7 +54,7 @@ async function openTestTabInOwnProcess(name, knownTabs) {
|
|||
knownTabs.byName.set(name, knownTab);
|
||||
|
||||
// Now trigger the actual load of our page.
|
||||
tab.linkedBrowser.loadURI(realUrl);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, realUrl);
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
is(tab.linkedBrowser.frameLoader.tabParent.osPid, pid, "still same pid");
|
||||
return knownTab;
|
||||
|
|
|
@ -22,6 +22,7 @@ SimpleTest.waitForExplicitFinish();
|
|||
SpecialPowers.pushPrefEnv({'set': [["beacon.enabled", true]]}, beginTest);
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
|
||||
var baseURL = "http://mochi.test:8888/chrome/dom/tests/mochitest/beacon/";
|
||||
|
||||
|
@ -54,7 +55,7 @@ function beginTest() {
|
|||
ok(true, "cookie set by beacon request in normal window");
|
||||
testOnPrivateWindow();
|
||||
}, "cookie-changed");
|
||||
aNormalWindow.gBrowser.selectedBrowser.loadURI(baseURL + "file_beaconCookies.html");
|
||||
BrowserTestUtils.loadURI(aNormalWindow.gBrowser.selectedBrowser, baseURL + "file_beaconCookies.html");
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -65,7 +66,7 @@ function testOnPrivateWindow() {
|
|||
ok(true, "private cookie set by beacon request in private window");
|
||||
cleanup();
|
||||
}, "private-cookie-changed");
|
||||
aPrivateWindow.gBrowser.selectedBrowser.loadURI(baseURL + "file_beaconCookies.html");
|
||||
BrowserTestUtils.loadURI(aPrivateWindow.gBrowser.selectedBrowser, baseURL + "file_beaconCookies.html");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -46,5 +46,5 @@ function test () {
|
|||
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(onLoad);
|
||||
|
||||
info("Loading download page...");
|
||||
gBrowser.loadURI("http://example.com/browser/dom/url/tests/empty.html");
|
||||
BrowserTestUtils.loadURI(gBrowser, "http://example.com/browser/dom/url/tests/empty.html");
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<body>
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
var mainWindow;
|
||||
|
||||
var contentPage = "http://mochi.test:8888/chrome/dom/workers/test/empty.html";
|
||||
|
@ -17,7 +17,7 @@ function testOnWindow(aIsPrivate, aCallback) {
|
|||
win.addEventListener("load", function() {
|
||||
win.addEventListener("DOMContentLoaded", function onInnerLoad() {
|
||||
if (win.content.location.href != contentPage) {
|
||||
win.gBrowser.loadURI(contentPage);
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ function testOnWindow(aIsPrivate, aCallback) {
|
|||
}, true);
|
||||
|
||||
if (!aIsPrivate) {
|
||||
win.gBrowser.loadURI(contentPage);
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
|
||||
}
|
||||
}, {capture: true, once: true});
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче