Bug 1472212 - Load http://example.org/ instead of about:home for some tests. r=Gijs

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

--HG--
extra : rebase_source : 158eb53174faa028edeebaf5970c123ba359a3e5
extra : intermediate-source : ebdca743668ce014c1cb9adfa00c1220256d357c
extra : source : a28443371b944ee00b1267dd5b9a22da6d28353b
This commit is contained in:
Jay Lim 2018-07-20 18:49:59 -04:00
parent e46b3ee73b
commit 492c6f6d69
2 changed files with 5 additions and 5 deletions

View File

@ -11,10 +11,10 @@ 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;
});

View File

@ -10,17 +10,17 @@ add_task(async function test() {
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);
});