forked from mirrors/gecko-dev
Bug 1811854 - switch remaining tests to BrowserTestUtils.loadURIString from BrowserTestUtils.loadURI, r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D167558
This commit is contained in:
parent
2020417cc0
commit
129735a58b
37 changed files with 57 additions and 65 deletions
|
|
@ -34,7 +34,7 @@
|
|||
let docLoaded = waitForEvent(EVENT_DOCUMENT_LOAD_COMPLETE, event =>
|
||||
event.accessible.QueryInterface(nsIAccessibleDocument).URL === ABOUT_LICENSE_URL,
|
||||
`Loaded tab: ${ABOUT_LICENSE_URL}`);
|
||||
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser,
|
||||
BrowserTestUtils.loadURIString(win.gBrowser.selectedBrowser,
|
||||
"about:license");
|
||||
await loaded;
|
||||
await docLoaded;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ async function doUrlbarTest({ trigger, assert }) {
|
|||
|
||||
async function doHandoffTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
BrowserTestUtils.loadURI(browser, "about:newtab");
|
||||
BrowserTestUtils.loadURIString(browser, "about:newtab");
|
||||
await BrowserTestUtils.browserStopped(browser, "about:newtab");
|
||||
await SpecialPowers.spawn(browser, [], function() {
|
||||
const searchInput = content.document.querySelector(".fake-editable");
|
||||
|
|
@ -54,7 +54,7 @@ async function doUrlbarAddonpageTest({ trigger, assert }) {
|
|||
|
||||
await doTest(async browser => {
|
||||
const onLoad = BrowserTestUtils.browserLoaded(browser);
|
||||
BrowserTestUtils.loadURI(browser, extensionURL);
|
||||
BrowserTestUtils.loadURIString(browser, extensionURL);
|
||||
await onLoad;
|
||||
await openPopup("x");
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ var TestRunner = {
|
|||
.removeAttribute("remotecontrol");
|
||||
|
||||
let selectedBrowser = browserWindow.gBrowser.selectedBrowser;
|
||||
lazy.BrowserTestUtils.loadURI(selectedBrowser, HOME_PAGE);
|
||||
lazy.BrowserTestUtils.loadURIString(selectedBrowser, HOME_PAGE);
|
||||
await lazy.BrowserTestUtils.browserLoaded(selectedBrowser);
|
||||
|
||||
for (let i = 0; i < this.combos.length; i++) {
|
||||
|
|
@ -242,7 +242,7 @@ var TestRunner = {
|
|||
gBrowser.removeTab(gBrowser.selectedTab, { animate: false });
|
||||
}
|
||||
gBrowser.unpinTab(gBrowser.selectedTab);
|
||||
lazy.BrowserTestUtils.loadURI(
|
||||
lazy.BrowserTestUtils.loadURIString(
|
||||
gBrowser.selectedBrowser,
|
||||
"data:text/html;charset=utf-8,<h1>Done!"
|
||||
);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,10 @@ var ControlCenter = {
|
|||
"navigator:browser"
|
||||
);
|
||||
let gBrowser = browserWindow.gBrowser;
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, channel.file.path);
|
||||
BrowserTestUtils.loadURIString(
|
||||
gBrowser.selectedBrowser,
|
||||
channel.file.path
|
||||
);
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
await openIdentityPopup();
|
||||
},
|
||||
|
|
@ -290,7 +293,7 @@ var ControlCenter = {
|
|||
async function loadPage(url) {
|
||||
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let gBrowser = browserWindow.gBrowser;
|
||||
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gBrowser.selectedBrowser, url);
|
||||
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, url);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
var testName = "[nostore]";
|
||||
|
||||
// Load a page with a no-store header
|
||||
BrowserTestUtils.loadURI(gBrowser, nostoreURI);
|
||||
BrowserTestUtils.loadURIString(gBrowser, nostoreURI);
|
||||
yield undefined;
|
||||
|
||||
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
// Load a new document into the browser
|
||||
var simple = "data:text/html,<html><head><title>test2</title></head>" +
|
||||
"<body>test2</body></html>";
|
||||
BrowserTestUtils.loadURI(gBrowser, simple);
|
||||
BrowserTestUtils.loadURIString(gBrowser, simple);
|
||||
yield undefined;
|
||||
|
||||
|
||||
|
|
@ -127,7 +127,7 @@
|
|||
|
||||
// Load a page with a no-cache header. This should not be
|
||||
// restricted like no-store (bug 567365)
|
||||
BrowserTestUtils.loadURI(gBrowser, nocacheURI);
|
||||
BrowserTestUtils.loadURIString(gBrowser, nocacheURI);
|
||||
yield undefined;
|
||||
|
||||
|
||||
|
|
@ -150,7 +150,7 @@
|
|||
isnot(currScrollY, originalYPosition,
|
||||
testName + " failed to scroll window vertically");
|
||||
|
||||
BrowserTestUtils.loadURI(gBrowser, simple);
|
||||
BrowserTestUtils.loadURIString(gBrowser, simple);
|
||||
yield undefined;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -86,9 +86,9 @@ windows.
|
|||
ok(nonRemote && !nonRemote.isRemoteBrowser,
|
||||
"Should have found a non-remote browser in test window " + num);
|
||||
|
||||
BrowserTestUtils.loadURI(remote, page);
|
||||
BrowserTestUtils.loadURIString(remote, page);
|
||||
await BrowserTestUtils.browserLoaded(remote);
|
||||
BrowserTestUtils.loadURI(nonRemote, page);
|
||||
BrowserTestUtils.loadURIString(nonRemote, page);
|
||||
await BrowserTestUtils.browserLoaded(nonRemote);
|
||||
|
||||
let result = {};
|
||||
|
|
|
|||
|
|
@ -63,7 +63,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);
|
||||
BrowserTestUtils.loadURI(browser, chromeDir + "bug415498-doc1.html");
|
||||
BrowserTestUtils.loadURIString(browser, chromeDir + "bug415498-doc1.html");
|
||||
yield undefined;
|
||||
|
||||
ok(verifyErrorReceived("HierarchyRequestError"),
|
||||
|
|
@ -72,7 +72,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);
|
||||
BrowserTestUtils.loadURI(browser, chromeDir + "bug415498-doc2.html");
|
||||
BrowserTestUtils.loadURIString(browser, chromeDir + "bug415498-doc2.html");
|
||||
yield undefined;
|
||||
|
||||
ok(verifyErrorReceived("HierarchyRequestError"),
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=617528
|
|||
</div>\
|
||||
</body>\
|
||||
</html>';
|
||||
BrowserTestUtils.loadURI(browser, uri);
|
||||
BrowserTestUtils.loadURIString(browser, uri);
|
||||
}
|
||||
|
||||
function onPageShow() {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ add_task(async function testPlaybackRecoveryFromCrash() {
|
|||
window.gBrowser,
|
||||
"about:blank"
|
||||
);
|
||||
BrowserTestUtils.loadURI(tab.linkedBrowser, VIDEO_PAGE);
|
||||
BrowserTestUtils.loadURIString(tab.linkedBrowser, VIDEO_PAGE);
|
||||
await BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
|
||||
await playVideo(tab);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ function testOnWindow(aIsPrivate, aCallback) {
|
|||
win.addEventListener("load", function() {
|
||||
win.addEventListener("DOMContentLoaded", function onInnerLoad() {
|
||||
if (win.content.location.href != contentPage) {
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
|
||||
BrowserTestUtils.loadURIString(win.gBrowser, contentPage);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ function beginTest() {
|
|||
ok(true, "cookie set by beacon request in normal window");
|
||||
testOnPrivateWindow();
|
||||
}, "cookie-changed");
|
||||
BrowserTestUtils.loadURI(aNormalWindow.gBrowser.selectedBrowser, baseURL + "file_beaconCookies.html");
|
||||
BrowserTestUtils.loadURIString(aNormalWindow.gBrowser.selectedBrowser, baseURL + "file_beaconCookies.html");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ function testOnPrivateWindow() {
|
|||
ok(true, "private cookie set by beacon request in private window");
|
||||
cleanup();
|
||||
}, "private-cookie-changed");
|
||||
BrowserTestUtils.loadURI(aPrivateWindow.gBrowser.selectedBrowser, baseURL + "file_beaconCookies.html");
|
||||
BrowserTestUtils.loadURIString(aPrivateWindow.gBrowser.selectedBrowser, baseURL + "file_beaconCookies.html");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ function beginTest() {
|
|||
testOnPrivateWindow();
|
||||
}, "cookie-changed");
|
||||
let testURL = baseURL + "file_beaconSafelist.html";
|
||||
BrowserTestUtils.loadURI(win.gBrowser.selectedBrowser, testURL);
|
||||
BrowserTestUtils.loadURIString(win.gBrowser.selectedBrowser, testURL);
|
||||
await BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser, false, testURL);
|
||||
await SpecialPowers.spawn(win.gBrowser.selectedBrowser, [], async () => {
|
||||
await new Promise((resolve, reject) => {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ function testOnWindow(aIsPrivate, aCallback) {
|
|||
win.addEventListener("load", function() {
|
||||
win.addEventListener("DOMContentLoaded", function onInnerLoad() {
|
||||
if (win.content.location.href != contentPage) {
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
|
||||
BrowserTestUtils.loadURIString(win.gBrowser, contentPage);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ add_task(async function() {
|
|||
try {
|
||||
const browser = win.gBrowser.selectedTab.linkedBrowser;
|
||||
|
||||
BrowserTestUtils.loadURI(browser, parentURL);
|
||||
BrowserTestUtils.loadURIString(browser, parentURL);
|
||||
await BrowserTestUtils.browserLoaded(browser, false, parentURL);
|
||||
|
||||
async function setup(url) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ add_task(async function test() {
|
|||
// new location.
|
||||
newWin.resizeTo(50, 50);
|
||||
|
||||
BrowserTestUtils.loadURI(newWin.gBrowser.selectedBrowser, URL);
|
||||
BrowserTestUtils.loadURIString(newWin.gBrowser.selectedBrowser, URL);
|
||||
await BrowserTestUtils.browserLoaded(newWin.gBrowser.selectedBrowser);
|
||||
|
||||
await SpecialPowers.spawn(
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ async function openPage(enableDialogs) {
|
|||
{ gBrowser, url: "about:blank" },
|
||||
async function(browser) {
|
||||
// Load the page.
|
||||
BrowserTestUtils.loadURI(browser, PAGE_URL);
|
||||
BrowserTestUtils.loadURIString(browser, PAGE_URL);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
// Load the content script in the frame.
|
||||
let methodName = enableDialogs ? "enableDialogs" : "disableDialogs";
|
||||
|
|
@ -57,7 +57,7 @@ async function openPage(enableDialogs) {
|
|||
content.windowUtils[name]();
|
||||
});
|
||||
// And then navigate away.
|
||||
BrowserTestUtils.loadURI(browser, "http://example.com/");
|
||||
BrowserTestUtils.loadURIString(browser, "http://example.com/");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ async function openPage(shouldClick) {
|
|||
{ gBrowser, url: "about:blank" },
|
||||
async function(browser) {
|
||||
// Load the page.
|
||||
BrowserTestUtils.loadURI(browser, PAGE_URL);
|
||||
BrowserTestUtils.loadURIString(browser, PAGE_URL);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
if (shouldClick) {
|
||||
|
|
@ -68,7 +68,7 @@ async function openPage(shouldClick) {
|
|||
"Click should update document interactivity state"
|
||||
);
|
||||
// And then navigate away.
|
||||
BrowserTestUtils.loadURI(browser, "http://example.com/");
|
||||
BrowserTestUtils.loadURIString(browser, "http://example.com/");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ async function openPage(shouldClick) {
|
|||
{ gBrowser, url: "about:blank" },
|
||||
async function(browser) {
|
||||
// Load the page.
|
||||
BrowserTestUtils.loadURI(browser, PAGE_URL);
|
||||
BrowserTestUtils.loadURIString(browser, PAGE_URL);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
let frameBC = browser.browsingContext.children[0];
|
||||
|
|
@ -89,7 +89,7 @@ async function openPage(shouldClick) {
|
|||
"Click should update frame interactivity state"
|
||||
);
|
||||
// And then navigate away.
|
||||
BrowserTestUtils.loadURI(browser, "http://example.com/");
|
||||
BrowserTestUtils.loadURIString(browser, "http://example.com/");
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ add_task(async function() {
|
|||
newWin.gBrowser.selectedBrowser,
|
||||
true /* includeSubFrames */
|
||||
);
|
||||
BrowserTestUtils.loadURI(newWin.gBrowser.selectedBrowser, pageUrl);
|
||||
BrowserTestUtils.loadURIString(newWin.gBrowser.selectedBrowser, pageUrl);
|
||||
await browserLoadedPromise;
|
||||
|
||||
newWin.gBrowser.selectedBrowser.focus();
|
||||
|
|
|
|||
|
|
@ -939,17 +939,6 @@ export var BrowserTestUtils = {
|
|||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Compatibility shim. Should go away Very Soon.
|
||||
* @param {xul:browser} browser
|
||||
* A xul:browser.
|
||||
* @param {string} uri
|
||||
* The URI to load.
|
||||
*/
|
||||
loadURI(browser, uri) {
|
||||
return this.loadURIString(browser, uri);
|
||||
},
|
||||
|
||||
/**
|
||||
* Maybe create a preloaded browser and ensure it's finished loading.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ function testOnWindow(aTestData) {
|
|||
subject => subject == win);
|
||||
|
||||
let browser = win.gBrowser.selectedBrowser;
|
||||
BrowserTestUtils.loadURI(browser, aTestData.url);
|
||||
BrowserTestUtils.loadURIString(browser, aTestData.url);
|
||||
await BrowserTestUtils.waitForContentEvent(browser, "DOMContentLoaded");
|
||||
|
||||
let doc = win.gBrowser.contentDocument;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ function testOnWindow(aTestData, aCallback, aTestCreater) {
|
|||
|
||||
var createBlockedIframe = function(aWindow, aBrowser, aTopUrl, aUrl) {
|
||||
(async function() {
|
||||
BrowserTestUtils.loadURI(aBrowser, aTopUrl);
|
||||
BrowserTestUtils.loadURIString(aBrowser, aTopUrl);
|
||||
await BrowserTestUtils.browserLoaded(aBrowser);
|
||||
|
||||
await SpecialPowers.spawn(aBrowser, [aUrl], async function(url) {
|
||||
|
|
@ -118,7 +118,7 @@ var createBlockedIframe = function(aWindow, aBrowser, aTopUrl, aUrl) {
|
|||
|
||||
var createBlockedPage = function(aWindow, aBrowser, aTopUrl, aUrl) {
|
||||
(async function() {
|
||||
BrowserTestUtils.loadURI(aBrowser, aTopUrl);
|
||||
BrowserTestUtils.loadURIString(aBrowser, aTopUrl);
|
||||
await BrowserTestUtils.waitForContentEvent(aBrowser, "DOMContentLoaded");
|
||||
|
||||
let doc = aWindow.gBrowser.contentDocument;
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ function testOnWindow(aTestData) {
|
|||
};
|
||||
win.gBrowser.addProgressListener(progressListener, Ci.nsIWebProgress.NOTIFY_CONTENT_BLOCKING);
|
||||
|
||||
BrowserTestUtils.loadURI(browser, aTestData.url);
|
||||
BrowserTestUtils.loadURIString(browser, aTestData.url);
|
||||
await BrowserTestUtils.browserLoaded(
|
||||
browser,
|
||||
false,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function testOnWindow(aPrivate, aCallback) {
|
|||
subject => subject == win).then(() => {
|
||||
win.addEventListener("DOMContentLoaded", function onInnerLoad() {
|
||||
if (win.content.location.href != contentPage) {
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
|
||||
BrowserTestUtils.loadURIString(win.gBrowser, contentPage);
|
||||
return;
|
||||
}
|
||||
win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
|
||||
|
|
@ -43,7 +43,7 @@ function testOnWindow(aPrivate, aCallback) {
|
|||
SimpleTest.executeSoon(function() { aCallback(win); });
|
||||
}, false, true);
|
||||
}, true);
|
||||
SimpleTest.executeSoon(function() { BrowserTestUtils.loadURI(win.gBrowser, contentPage); });
|
||||
SimpleTest.executeSoon(function() { BrowserTestUtils.loadURIString(win.gBrowser, contentPage); });
|
||||
});
|
||||
}, {capture: true, once: true});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ function testOnWindow(contentPage) {
|
|||
subject => subject == win).then(() => {
|
||||
win.addEventListener("DOMContentLoaded", function onInnerLoad() {
|
||||
if (win.content.location.href != contentPage) {
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
|
||||
BrowserTestUtils.loadURIString(win.gBrowser, contentPage);
|
||||
return;
|
||||
}
|
||||
win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
|
||||
|
|
@ -44,7 +44,7 @@ function testOnWindow(contentPage) {
|
|||
}, false, true);
|
||||
}, true);
|
||||
SimpleTest.executeSoon(function() {
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
|
||||
BrowserTestUtils.loadURIString(win.gBrowser, contentPage);
|
||||
});
|
||||
});
|
||||
}, {capture: true, once: true});
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ function testOnWindow(contentPage) {
|
|||
subject => subject == win).then(() => {
|
||||
win.addEventListener("DOMContentLoaded", function onInnerLoad() {
|
||||
if (win.content.location.href != contentPage) {
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
|
||||
BrowserTestUtils.loadURIString(win.gBrowser, contentPage);
|
||||
return;
|
||||
}
|
||||
win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
|
||||
|
|
@ -45,7 +45,7 @@ function testOnWindow(contentPage) {
|
|||
}, false, true);
|
||||
}, true);
|
||||
SimpleTest.executeSoon(function() {
|
||||
BrowserTestUtils.loadURI(win.gBrowser, contentPage);
|
||||
BrowserTestUtils.loadURIString(win.gBrowser, contentPage);
|
||||
});
|
||||
});
|
||||
}, {capture: true, once: true});
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
gBrowser = document.getElementById(browserId);
|
||||
gFindBar.browser = gBrowser;
|
||||
let promise = BrowserTestUtils.browserLoaded(gBrowser);
|
||||
BrowserTestUtils.loadURI(gBrowser, 'data:text/html,<h2>Text mozilla</h2><input id="inp" type="text" />');
|
||||
BrowserTestUtils.loadURIString(gBrowser, 'data:text/html,<h2>Text mozilla</h2><input id="inp" type="text" />');
|
||||
await promise;
|
||||
await onDocumentLoaded();
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@
|
|||
// For posterity, test iframes too.
|
||||
|
||||
promise = BrowserTestUtils.browserLoaded(gBrowser);
|
||||
BrowserTestUtils.loadURI(gBrowser, 'data:text/html,<h2>Text mozilla</h2><iframe id="leframe" ' +
|
||||
BrowserTestUtils.loadURIString(gBrowser, 'data:text/html,<h2>Text mozilla</h2><iframe id="leframe" ' +
|
||||
'src="data:text/html,Text mozilla"></iframe>');
|
||||
await promise;
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ find-menu appears in editor element which has had makeEditable() called but desi
|
|||
addEventListener("DOMContentLoaded", () => resolve(), { once: true });
|
||||
});
|
||||
});
|
||||
BrowserTestUtils.loadURI(gBrowser, "data:text/html;charset=utf-8,some%20random%20text");
|
||||
BrowserTestUtils.loadURIString(gBrowser, "data:text/html;charset=utf-8,some%20random%20text");
|
||||
await promise;
|
||||
await onDocumentLoaded();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
gBrowser = document.getElementById(browserId);
|
||||
gFindBar.browser = gBrowser;
|
||||
let promise = BrowserTestUtils.browserLoaded(gBrowser);
|
||||
BrowserTestUtils.loadURI(gBrowser, "data:text/plain,latest");
|
||||
BrowserTestUtils.loadURIString(gBrowser, "data:text/plain,latest");
|
||||
await promise;
|
||||
await onDocumentLoaded();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
addEventListener("DOMContentLoaded", () => resolve(), { once: true });
|
||||
});
|
||||
});
|
||||
BrowserTestUtils.loadURI(gBrowser, "data:text/html,<form><input id='input' type='text' value='text inside an input element'></form>");
|
||||
BrowserTestUtils.loadURIString(gBrowser, "data:text/html,<form><input id='input' type='text' value='text inside an input element'></form>");
|
||||
await loadedPromise;
|
||||
await contentLoadedPromise;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
gFindBar = document.getElementById("FindToolbar");
|
||||
gBrowser = document.getElementById("content");
|
||||
gBrowser.addEventListener("pageshow", onPageShow, { once: true });
|
||||
BrowserTestUtils.loadURI(gBrowser, 'data:text/html,<h2>Text mozilla</h2><input id="inp" type="text" />');
|
||||
BrowserTestUtils.loadURIString(gBrowser, 'data:text/html,<h2>Text mozilla</h2><input id="inp" type="text" />');
|
||||
}
|
||||
|
||||
function onPageShow() {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
gFindBar = document.getElementById("FindToolbar");
|
||||
gBrowser = document.getElementById("content");
|
||||
gBrowser.addEventListener("pageshow", onPageShow, { once: true });
|
||||
BrowserTestUtils.loadURI(gBrowser, "data:text/html,<h2 id='h2'>mozilla</h2>");
|
||||
BrowserTestUtils.loadURIString(gBrowser, "data:text/html,<h2 id='h2'>mozilla</h2>");
|
||||
}
|
||||
setTimeout(_delayedOnLoad, 1000);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
gBrowser.addEventListener("pageshow", onPageShow, { once: true });
|
||||
let data = `data:text/html,<input id="inp" type="text" />
|
||||
<textarea id="tarea"/>`;
|
||||
BrowserTestUtils.loadURI(gBrowser, data);
|
||||
BrowserTestUtils.loadURIString(gBrowser, data);
|
||||
}
|
||||
|
||||
function promiseHighlightFinished() {
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
gBrowser = document.getElementById(browserId);
|
||||
|
||||
let promise = BrowserTestUtils.browserLoaded(gBrowser);
|
||||
BrowserTestUtils.loadURI(gBrowser, kBaseURL + "/sample_entireword_" + testName + ".html");
|
||||
BrowserTestUtils.loadURIString(gBrowser, kBaseURL + "/sample_entireword_" + testName + ".html");
|
||||
await promise;
|
||||
gFindBar.browser = gBrowser;
|
||||
await onDocumentLoaded(testName);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
gBrowser = document.getElementById(browserId);
|
||||
const url = "data:text/html,hello there";
|
||||
let promise = BrowserTestUtils.browserLoaded(gBrowser, false, url);
|
||||
BrowserTestUtils.loadURI(gBrowser, url);
|
||||
BrowserTestUtils.loadURIString(gBrowser, url);
|
||||
await promise;
|
||||
gFindBar.browser = gBrowser;
|
||||
await onDocumentLoaded();
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@
|
|||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
|
||||
let promise = BrowserTestUtils.browserLoaded(gBrowser);
|
||||
BrowserTestUtils.loadURI(gBrowser, "data:text/html;charset=utf-8,<h2 id='h2'>" + SEARCH_TEXT +
|
||||
BrowserTestUtils.loadURIString(gBrowser, "data:text/html;charset=utf-8,<h2 id='h2'>" + SEARCH_TEXT +
|
||||
"</h2><h2><a href='" + SAMPLE_URL + "'>Link Test</a></h2><input id='text' type='text' value='" +
|
||||
SAMPLE_TEXT + "'></input><input id='button' type='button'></input><img id='img' width='50' height='50'/>",
|
||||
{ triggeringPrincipal: window.document.nodePrincipal });
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
// 6) Start reloading first tab.
|
||||
function loadFirstTab() {
|
||||
var browser = document.getElementById("tab1browser");
|
||||
BrowserTestUtils.loadURI(browser, "data:text/html;charset=utf-8,<body><h2>First Tab</h2><p><input type='submit' value='Button' id='button1'/></body>");
|
||||
BrowserTestUtils.loadURIString(browser, "data:text/html;charset=utf-8,<body><h2>First Tab</h2><p><input type='submit' value='Button' id='button1'/></body>");
|
||||
}
|
||||
|
||||
function configureFirstTab() {
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
// 8) Start loading second tab.
|
||||
function loadSecondTab() {
|
||||
var browser = document.getElementById("tab2browser");
|
||||
BrowserTestUtils.loadURI(browser, "data:text/html;charset=utf-8,<body><h2>Second Tab</h2><p><input type='submit' value='Button' id='button1'/></body>");
|
||||
BrowserTestUtils.loadURIString(browser, "data:text/html;charset=utf-8,<body><h2>Second Tab</h2><p><input type='submit' value='Button' id='button1'/></body>");
|
||||
}
|
||||
|
||||
function configureSecondTab() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue