Bug 1399854 - Intermittent browser/components/newtab/tests/browser/browser_newtab_overrides.js leaked 2 windows until shutdown r=Mardak
authorUrsula Sarracini
Wed, 01 Nov 2017 10:11:18 -0400
changeset 440354 f4c0f4165f133ad954475f9b664a3d6a7c9d0257
parent 440353 38ae6313a318ea426b1c852e6276780d0e6fbf08
child 440355 a70f460a51261e2ca5466593400484606c767076
push id8114
push userjlorenzo@mozilla.com
push dateThu, 02 Nov 2017 16:33:21 +0000
treeherdermozilla-beta@73e0d89a540f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMardak
bugs1399854
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1399854 - Intermittent browser/components/newtab/tests/browser/browser_newtab_overrides.js leaked 2 windows until shutdown r=Mardak MozReview-Commit-ID: e4fs23Rdmn
browser/components/newtab/tests/browser/browser.ini
browser/components/newtab/tests/browser/browser_newtab_overrides.js
browser/components/newtab/tests/browser/browser_remotenewtab_pageloads.js
browser/components/newtab/tests/browser/dummy_page.html
--- a/browser/components/newtab/tests/browser/browser.ini
+++ b/browser/components/newtab/tests/browser/browser.ini
@@ -1,7 +1,3 @@
 [DEFAULT]
-support-files =
-  dummy_page.html
 
-[browser_remotenewtab_pageloads.js]
 [browser_newtab_overrides.js]
-skip-if = true # bug 1399854
--- a/browser/components/newtab/tests/browser/browser_newtab_overrides.js
+++ b/browser/components/newtab/tests/browser/browser_newtab_overrides.js
@@ -17,17 +17,17 @@ registerCleanupFunction(function() {
 });
 
 /*
  * Tests that the default newtab page is always returned when one types "about:newtab" in the URL bar,
  * even when overridden.
  */
 add_task(async function redirector_ignores_override() {
   let overrides = [
-    "chrome://browser/content/downloads/contentAreaDownloadsView.xul",
+    "chrome://browser/content/aboutRobots.xhtml",
     "about:home",
   ];
 
   for (let overrideURL of overrides) {
     let notificationPromise = nextChangeNotificationPromise(overrideURL, `newtab page now points to ${overrideURL}`);
     aboutNewTabService.newTabURL = overrideURL;
 
     await notificationPromise;
@@ -57,17 +57,17 @@ add_task(async function redirector_ignor
   }
 });
 
 /*
  * Tests loading an overridden newtab page by simulating opening a newtab page from chrome
  */
 add_task(async function override_loads_in_browser() {
   let overrides = [
-    "chrome://browser/content/downloads/contentAreaDownloadsView.xul",
+    "chrome://browser/content/aboutRobots.xhtml",
     "about:home",
     " about:home",
   ];
 
   for (let overrideURL of overrides) {
     let notificationPromise = nextChangeNotificationPromise(overrideURL.trim(), `newtab page now points to ${overrideURL}`);
     aboutNewTabService.newTabURL = overrideURL;
 
deleted file mode 100644
--- a/browser/components/newtab/tests/browser/browser_remotenewtab_pageloads.js
+++ /dev/null
@@ -1,50 +0,0 @@
-"use strict";
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
-                                   "@mozilla.org/browser/aboutnewtab-service;1",
-                                   "nsIAboutNewTabService");
-
-const TEST_URL = "https://example.com/browser/browser/components/newtab/tests/browser/dummy_page.html";
-
-/*
- * Tests opening a newtab page with a remote URL. Simulates a newtab open from chrome
- */
-add_task(async function open_newtab() {
-  let notificationPromise = nextChangeNotificationPromise(TEST_URL, "newtab page now points to test url");
-  aboutNewTabService.newTabURL = TEST_URL;
-
-  await notificationPromise;
-  Assert.ok(aboutNewTabService.overridden, "url has been overridden");
-
-  /*
-   * Simulate a newtab open as a user would.
-   *
-   * Bug 1240169 - We cannot set the URL to about:newtab because that would invoke the redirector.
-   * The redirector always yields the loading of a default newtab URL. We expect the user to use
-   * the browser UI to access overriding URLs, for istance by click on the "+" button in the tab
-   * bar, or by using the new tab shortcut key.
-   */
-  BrowserOpenTab(); // jshint ignore:line
-
-  let browser = gBrowser.selectedBrowser;
-  await BrowserTestUtils.browserLoaded(browser);
-
-  await ContentTask.spawn(browser, {url: TEST_URL}, async function(args) {
-    Assert.equal(content.document.location.href, args.url,
-      "document.location should match the external resource");
-    Assert.equal(content.document.documentURI, args.url,
-      "document.documentURI should match the external resource");
-    Assert.equal(content.document.nodePrincipal.URI.spec, args.url,
-      "nodePrincipal should match the external resource");
-  });
-  await BrowserTestUtils.removeTab(gBrowser.selectedTab);
-});
-
-function nextChangeNotificationPromise(aNewURL, testMessage) {
-  return TestUtils.topicObserved("newtab-url-changed", function observer(aSubject, aData) { // jshint unused:false
-      Assert.equal(aData, aNewURL, testMessage);
-      return true;
-  });
-}
deleted file mode 100644
--- a/browser/components/newtab/tests/browser/dummy_page.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-  <meta charset="utf-8">
-</head>
-<body>
-<p>Dummy Page</p>
-</body>
-</html>