Bug 1472212 - Load `http://example.org/` instead of `about:home` for some tests.
These tests were timing out because `about:home` now runs in a different process.
Since these two tests aim to test something else (e.g. window leaks when
navigating between pages), we will redirect to a URL that loads in the same
process instead of `about:home` to avoid adding extra conditions for the
process flip.
See
Bug 1336811 and
Bug 1242643.
MozReview-Commit-ID: G0rhfA973R9
--- a/dom/xhr/tests/browser_xhr_onchange_leak.js
+++ b/dom/xhr/tests/browser_xhr_onchange_leak.js
@@ -6,18 +6,18 @@
// Bug 1336811 - An XHR that has a .onreadystatechange waiting should
// not leak forever once the tab is closed. CC optimizations need to be
// turned off once it is closed.
add_task(async function test() {
const url = "http://mochi.test:8888/browser/dom/xhr/tests/browser_xhr_onchange_leak.html";
let newTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
let browser = gBrowser.selectedBrowser;
- let done = await ContentTask.spawn(browser,{}, async function(browser){
+ let done = await ContentTask.spawn(browser, {}, async function(browser) {
let doc = content.document;
let promise = ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true);
- content.location = "about:home";
+ content.location = "http://example.org/";
await promise;
return true;
});
is(done, true, "need to check something");
BrowserTestUtils.removeTab(newTab);
});
--- a/js/xpconnect/tests/browser/browser_dead_object.js
+++ b/js/xpconnect/tests/browser/browser_dead_object.js
@@ -5,22 +5,22 @@
// For bug 773980, test that Components.utils.isDeadWrapper works as expected.
add_task(async function test() {
const url = "http://mochi.test:8888/browser/js/xpconnect/tests/browser/browser_deadObjectOnUnload.html";
let newTab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
let browser = gBrowser.selectedBrowser;
let innerWindowId = browser.innerWindowID;
- let contentDocDead = await ContentTask.spawn(browser,{innerWindowId}, async function(args){
+ let contentDocDead = await ContentTask.spawn(browser, {innerWindowId}, async function(args) {
let doc = content.document;
let {TestUtils} = ChromeUtils.import("resource://testing-common/TestUtils.jsm", {});
let promise = TestUtils.topicObserved("inner-window-nuked", (subject, data) => {
let id = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
return id == args.innerWindowId;
});
- content.location = "about:home";
+ content.location = "http://example.org/";
await promise;
return Cu.isDeadWrapper(doc);
});
is(contentDocDead, true, "wrapper is dead");
- BrowserTestUtils.removeTab(newTab);
+ BrowserTestUtils.removeTab(newTab);
});