Bug 1472212 - Load `http://example.org/` instead of `about:home` for some tests. draft
authorJay Lim <jlim@mozilla.com>
Fri, 20 Jul 2018 18:49:59 -0400
changeset 828638 9f15e83ed961
parent 828637 eb46f9ad3306
child 828639 0253c55229c4
push id118687
push userbmo:jay@imjching.com
push dateSun, 12 Aug 2018 15:25:52 +0000
bugs1472212, 1336811, 1242643
milestone63.0a1
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
dom/xhr/tests/browser_xhr_onchange_leak.js
js/xpconnect/tests/browser/browser_dead_object.js
--- 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);
 });