Bug 1395305 - Turn Activity Stream off for tests in browser/components/migration/tests/browser/ draft
authorUrsula Sarracini
Wed, 30 Aug 2017 15:52:36 -0400
changeset 656154 4138900b04284bcb2089c9aeb33e8760e0d6463e
parent 655774 ab2d700fda2b4934d24227216972dce9fac19b74
child 729034 7f7a64368753568db72e0d4e07a2374d380f55ab
push id77093
push userusarracini@mozilla.com
push dateWed, 30 Aug 2017 19:52:50 +0000
bugs1395305
milestone57.0a1
Bug 1395305 - Turn Activity Stream off for tests in browser/components/migration/tests/browser/ MozReview-Commit-ID: 7zlHRGQqEZH
browser/components/migration/tests/browser/browser.ini
browser/components/migration/tests/browser/browser_undo_notification.js
--- a/browser/components/migration/tests/browser/browser.ini
+++ b/browser/components/migration/tests/browser/browser.ini
@@ -1,3 +1,8 @@
+[DEFAULT]
+prefs =
+    browser.newtabpage.activity-stream.enabled=false
+    browser.newtabpage.preload=false
+
 [browser_undo_notification.js]
 [browser_undo_notification_wording.js]
 [browser_undo_notification_multiple_dismissal.js]
--- a/browser/components/migration/tests/browser/browser_undo_notification.js
+++ b/browser/components/migration/tests/browser/browser_undo_notification.js
@@ -14,25 +14,16 @@ const kExpectedNotificationId = "automig
 add_task(async function autoMigrationUndoNotificationShows() {
   let getNotification = browser =>
     gBrowser.getNotificationBox(browser).getNotificationWithValue(kExpectedNotificationId);
 
   scope.AutoMigrate.canUndo = () => true;
   let undoCalled;
   scope.AutoMigrate.undo = () => { undoCalled = true };
 
-  // Disable preloaded activity-stream about:newtab for this test to only run on
-  // the tiles version
-  await SpecialPowers.pushPrefEnv({set: [
-    ["browser.newtabpage.activity-stream.enabled", false],
-    ["browser.newtab.preload", false]
-  ]});
-  // Open and close about:newtab to remove any preloaded activity-stream version
-  await BrowserTestUtils.removeTab(await BrowserTestUtils.openNewForegroundTab(gBrowser));
-
   for (let url of ["about:newtab", "about:home"]) {
     undoCalled = false;
     // Can't use pushPrefEnv because of bug 1323779
     Services.prefs.setCharPref("browser.migrate.automigrate.browser", "someunknownbrowser");
     let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url, false);
     let browser = tab.linkedBrowser;
     if (!getNotification(browser)) {
       info(`Notification for ${url} not immediately present, waiting for it.`);