Bug 1376892 - Move browser_about* tests from 'general' to 'about' folder. r=jaws
authorPerry Jiang <jiangperry@gmail.com>
Tue, 11 Jul 2017 09:47:27 -0700
changeset 370007 dbb63faa7da342f7e55ab65c33e905dafd5b7295
parent 370006 bb2904560e11fcaded572b00e0b1f434844a43c5
child 370008 b25d6223cf67202d09930defbf08e6bacb60fc4d
push id32209
push userarchaeopteryx@coole-files.de
push dateFri, 21 Jul 2017 12:15:28 +0000
treeherdermozilla-central@874cdf9f9c9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1376892
milestone56.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 1376892 - Move browser_about* tests from 'general' to 'about' folder. r=jaws
browser/base/content/test/about/POSTSearchEngine.xml
browser/base/content/test/about/aboutHome_content_script.js
browser/base/content/test/about/browser.ini
browser/base/content/test/about/browser_aboutCertError.js
browser/base/content/test/about/browser_aboutHealthReport.js
browser/base/content/test/about/browser_aboutHome.js
browser/base/content/test/about/browser_aboutHome_wrapsCorrectly.js
browser/base/content/test/about/browser_aboutNetError.js
browser/base/content/test/about/browser_aboutSupport.js
browser/base/content/test/about/browser_aboutSupport_newtab_security_state.js
browser/base/content/test/about/head.js
browser/base/content/test/about/healthreport_pingData.js
browser/base/content/test/about/healthreport_testRemoteCommands.html
browser/base/content/test/about/print_postdata.sjs
browser/base/content/test/about/searchSuggestionEngine.sjs
browser/base/content/test/about/searchSuggestionEngine.xml
browser/base/content/test/about/test_bug959531.html
browser/base/content/test/general/aboutHome_content_script.js
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_aboutCertError.js
browser/base/content/test/general/browser_aboutHealthReport.js
browser/base/content/test/general/browser_aboutHome.js
browser/base/content/test/general/browser_aboutHome_wrapsCorrectly.js
browser/base/content/test/general/browser_aboutNetError.js
browser/base/content/test/general/browser_aboutSupport.js
browser/base/content/test/general/browser_aboutSupport_newtab_security_state.js
browser/base/content/test/general/head.js
browser/base/content/test/general/healthreport_pingData.js
browser/base/content/test/general/healthreport_testRemoteCommands.html
browser/base/content/test/general/test_bug959531.html
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/about/POSTSearchEngine.xml
@@ -0,0 +1,6 @@
+<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
+  <ShortName>POST Search</ShortName>
+  <Url type="text/html" method="POST" template="http://mochi.test:8888/browser/browser/base/content/test/about/print_postdata.sjs">
+    <Param name="searchterms" value="{searchTerms}"/>
+  </Url>
+</OpenSearchDescription>
rename from browser/base/content/test/general/aboutHome_content_script.js
rename to browser/base/content/test/about/aboutHome_content_script.js
--- a/browser/base/content/test/about/browser.ini
+++ b/browser/base/content/test/about/browser.ini
@@ -1,1 +1,21 @@
+[DEFAULT]
+support-files =
+  aboutHome_content_script.js
+  head.js
+  healthreport_pingData.js
+  healthreport_testRemoteCommands.html
+  print_postdata.sjs
+  searchSuggestionEngine.sjs
+  searchSuggestionEngine.xml
+  test_bug959531.html
+  POSTSearchEngine.xml
+
+[browser_aboutCertError.js]
 [browser_aboutStopReload.js]
+[browser_aboutNetError.js]
+[browser_aboutSupport.js]
+[browser_aboutSupport_newtab_security_state.js]
+[browser_aboutHealthReport.js]
+skip-if = os == "linux" # Bug 924307
+[browser_aboutHome.js]
+[browser_aboutHome_wrapsCorrectly.js]
rename from browser/base/content/test/general/browser_aboutCertError.js
rename to browser/base/content/test/about/browser_aboutCertError.js
rename from browser/base/content/test/general/browser_aboutHealthReport.js
rename to browser/base/content/test/about/browser_aboutHealthReport.js
--- a/browser/base/content/test/general/browser_aboutHealthReport.js
+++ b/browser/base/content/test/about/browser_aboutHealthReport.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 
-const CHROME_BASE = "chrome://mochitests/content/browser/browser/base/content/test/general/";
-const HTTPS_BASE = "https://example.com/browser/browser/base/content/test/general/";
+const CHROME_BASE = "chrome://mochitests/content/browser/browser/base/content/test/about/";
+const HTTPS_BASE = "https://example.com/browser/browser/base/content/test/about/";
 
 const TELEMETRY_LOG_PREF = "toolkit.telemetry.log.level";
 const telemetryOriginalLogPref = Preferences.get(TELEMETRY_LOG_PREF, null);
 
 const originalReportUrl = Services.prefs.getCharPref("datareporting.healthreport.about.reportUrl");
 
 registerCleanupFunction(function() {
   // Ensure we don't pollute prefs for next tests.
rename from browser/base/content/test/general/browser_aboutHome.js
rename to browser/base/content/test/about/browser_aboutHome.js
--- a/browser/base/content/test/general/browser_aboutHome.js
+++ b/browser/base/content/test/about/browser_aboutHome.js
@@ -7,17 +7,17 @@ requestLongerTimeout(4);
 ignoreAllUncaughtExceptions();
 
 XPCOMUtils.defineLazyModuleGetter(this, "AboutHomeUtils",
   "resource:///modules/AboutHome.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
   "resource://gre/modules/AppConstants.jsm");
 
 const TEST_CONTENT_HELPER = "chrome://mochitests/content/browser/browser/base/" +
-  "content/test/general/aboutHome_content_script.js";
+  "content/test/about/aboutHome_content_script.js";
 var gRightsVersion = Services.prefs.getIntPref("browser.rights.version");
 
 registerCleanupFunction(function() {
   // Ensure we don't pollute prefs for next tests.
   Services.prefs.clearUserPref("network.cookies.cookieBehavior");
   Services.prefs.clearUserPref("network.cookie.lifetimePolicy");
   Services.prefs.clearUserPref("browser.rights.override");
   Services.prefs.clearUserPref("browser.rights." + gRightsVersion + ".shown");
@@ -264,28 +264,28 @@ add_task(async function() {
 
         Services.search.defaultEngine = currEngine;
         try {
           Services.search.removeEngine(engine);
         } catch (ex) {}
         resolve();
       };
       Services.obs.addObserver(searchObserver, "browser-search-engine-modified");
-      Services.search.addEngine("http://test:80/browser/browser/base/content/test/general/POSTSearchEngine.xml",
+      Services.search.addEngine("http://test:80/browser/browser/base/content/test/about/POSTSearchEngine.xml",
                                 null, null, false);
     });
   });
 });
 
 add_task(async function() {
   info("Make sure that a page can't imitate about:home");
 
   await BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, async function(browser) {
     let promise = BrowserTestUtils.browserLoaded(browser);
-    browser.loadURI("https://example.com/browser/browser/base/content/test/general/test_bug959531.html");
+    browser.loadURI("https://example.com/browser/browser/base/content/test/about/test_bug959531.html");
     await promise;
 
     await ContentTask.spawn(browser, null, async function() {
       let button = content.document.getElementById("settings");
       ok(button, "Found settings button in test page");
       button.click();
     });
 
rename from browser/base/content/test/general/browser_aboutHome_wrapsCorrectly.js
rename to browser/base/content/test/about/browser_aboutHome_wrapsCorrectly.js
rename from browser/base/content/test/general/browser_aboutNetError.js
rename to browser/base/content/test/about/browser_aboutNetError.js
rename from browser/base/content/test/general/browser_aboutSupport.js
rename to browser/base/content/test/about/browser_aboutSupport.js
rename from browser/base/content/test/general/browser_aboutSupport_newtab_security_state.js
rename to browser/base/content/test/about/browser_aboutSupport_newtab_security_state.js
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/about/head.js
@@ -0,0 +1,155 @@
+/* eslint-env mozilla/frame-script */
+
+function waitForCondition(condition, nextTest, errorMsg, retryTimes) {
+  retryTimes = typeof retryTimes !== "undefined" ? retryTimes : 30;
+  var tries = 0;
+  var interval = setInterval(function() {
+    if (tries >= retryTimes) {
+      ok(false, errorMsg);
+      moveOn();
+    }
+    var conditionPassed;
+    try {
+      conditionPassed = condition();
+    } catch (e) {
+      ok(false, e + "\n" + e.stack);
+      conditionPassed = false;
+    }
+    if (conditionPassed) {
+      moveOn();
+    }
+    tries++;
+  }, 100);
+  var moveOn = function() { clearInterval(interval); nextTest(); };
+}
+
+function promiseWaitForCondition(aConditionFn) {
+  return new Promise(resolve => {
+    waitForCondition(aConditionFn, resolve, "Condition didn't pass.");
+  });
+}
+
+function whenTabLoaded(aTab, aCallback) {
+  promiseTabLoadEvent(aTab).then(aCallback);
+}
+
+function promiseTabLoaded(aTab) {
+  return new Promise(resolve => {
+    whenTabLoaded(aTab, resolve);
+  });
+}
+
+/**
+ * Waits for a load (or custom) event to finish in a given tab. If provided
+ * load an uri into the tab.
+ *
+ * @param tab
+ *        The tab to load into.
+ * @param [optional] url
+ *        The url to load, or the current url.
+ * @return {Promise} resolved when the event is handled.
+ * @resolves to the received event
+ * @rejects if a valid load event is not received within a meaningful interval
+ */
+function promiseTabLoadEvent(tab, url) {
+  info("Wait tab event: load");
+
+  function handle(loadedUrl) {
+    if (loadedUrl === "about:blank" || (url && loadedUrl !== url)) {
+      info(`Skipping spurious load event for ${loadedUrl}`);
+      return false;
+    }
+
+    info("Tab event received: load");
+    return true;
+  }
+
+  let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, handle);
+
+  if (url)
+    BrowserTestUtils.loadURI(tab.linkedBrowser, url);
+
+  return loaded;
+}
+
+/**
+ * Waits for the next top-level document load in the current browser.  The URI
+ * of the document is compared against aExpectedURL.  The load is then stopped
+ * before it actually starts.
+ *
+ * @param aExpectedURL
+ *        The URL of the document that is expected to load.
+ * @param aStopFromProgressListener
+ *        Whether to cancel the load directly from the progress listener. Defaults to true.
+ *        If you're using this method to avoid hitting the network, you want the default (true).
+ *        However, the browser UI will behave differently for loads stopped directly from
+ *        the progress listener (effectively in the middle of a call to loadURI) and so there
+ *        are cases where you may want to avoid stopping the load directly from within the
+ *        progress listener callback.
+ * @return promise
+ */
+function waitForDocLoadAndStopIt(aExpectedURL, aBrowser = gBrowser.selectedBrowser, aStopFromProgressListener = true) {
+  function content_script(contentStopFromProgressListener) {
+    let { interfaces: Ci, utils: Cu } = Components;
+    Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+    let wp = docShell.QueryInterface(Ci.nsIWebProgress);
+
+    function stopContent(now, uri) {
+      if (now) {
+        /* Hammer time. */
+        content.stop();
+
+        /* Let the parent know we're done. */
+        sendAsyncMessage("Test:WaitForDocLoadAndStopIt", { uri });
+      } else {
+        setTimeout(stopContent.bind(null, true, uri), 0);
+      }
+    }
+
+    let progressListener = {
+      onStateChange(webProgress, req, flags, status) {
+        dump("waitForDocLoadAndStopIt: onStateChange " + flags.toString(16) + ": " + req.name + "\n");
+
+        if (webProgress.isTopLevel &&
+            flags & Ci.nsIWebProgressListener.STATE_START) {
+          wp.removeProgressListener(progressListener);
+
+          let chan = req.QueryInterface(Ci.nsIChannel);
+          dump(`waitForDocLoadAndStopIt: Document start: ${chan.URI.spec}\n`);
+
+          stopContent(contentStopFromProgressListener, chan.originalURI.spec);
+        }
+      },
+      QueryInterface: XPCOMUtils.generateQI(["nsISupportsWeakReference"])
+    };
+    wp.addProgressListener(progressListener, wp.NOTIFY_STATE_WINDOW);
+
+    /**
+     * As |this| is undefined and we can't extend |docShell|, adding an unload
+     * event handler is the easiest way to ensure the weakly referenced
+     * progress listener is kept alive as long as necessary.
+     */
+    addEventListener("unload", function() {
+      try {
+        wp.removeProgressListener(progressListener);
+      } catch (e) { /* Will most likely fail. */ }
+    });
+  }
+
+  return new Promise((resolve, reject) => {
+    function complete({ data }) {
+      is(data.uri, aExpectedURL, "waitForDocLoadAndStopIt: The expected URL was loaded");
+      mm.removeMessageListener("Test:WaitForDocLoadAndStopIt", complete);
+      resolve();
+    }
+
+    let mm = aBrowser.messageManager;
+    mm.loadFrameScript("data:,(" + content_script.toString() + ")(" + aStopFromProgressListener + ");", true);
+    mm.addMessageListener("Test:WaitForDocLoadAndStopIt", complete);
+    info("waitForDocLoadAndStopIt: Waiting for URL: " + aExpectedURL);
+  });
+}
+
+function promiseDisableOnboardingTours() {
+  return SpecialPowers.pushPrefEnv({set: [["browser.onboarding.enabled", false]]});
+}
rename from browser/base/content/test/general/healthreport_pingData.js
rename to browser/base/content/test/about/healthreport_pingData.js
rename from browser/base/content/test/general/healthreport_testRemoteCommands.html
rename to browser/base/content/test/about/healthreport_testRemoteCommands.html
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/about/print_postdata.sjs
@@ -0,0 +1,22 @@
+const CC = Components.Constructor;
+const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
+                             "nsIBinaryInputStream",
+                             "setInputStream");
+
+function handleRequest(request, response) {
+  response.setHeader("Content-Type", "text/plain", false);
+  if (request.method == "GET") {
+    response.write(request.queryString);
+  } else {
+    var body = new BinaryInputStream(request.bodyInputStream);
+
+    var avail;
+    var bytes = [];
+
+    while ((avail = body.available()) > 0)
+      Array.prototype.push.apply(bytes, body.readByteArray(avail));
+
+    var data = String.fromCharCode.apply(null, bytes);
+    response.bodyOutputStream.write(data, data.length);
+  }
+}
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/about/searchSuggestionEngine.sjs
@@ -0,0 +1,9 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function handleRequest(req, resp) {
+  let suffixes = ["foo", "bar"];
+  let data = [req.queryString, suffixes.map(s => req.queryString + s)];
+  resp.setHeader("Content-Type", "application/json", false);
+  resp.write(JSON.stringify(data));
+}
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/about/searchSuggestionEngine.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Any copyright is dedicated to the Public Domain.
+   - http://creativecommons.org/publicdomain/zero/1.0/ -->
+
+<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
+<ShortName>browser_searchSuggestionEngine searchSuggestionEngine.xml</ShortName>
+<Url type="application/x-suggestions+json" method="GET" template="http://mochi.test:8888/browser/browser/base/content/test/about/searchSuggestionEngine.sjs?{searchTerms}"/>
+<Url type="text/html" method="GET" template="http://mochi.test:8888/" rel="searchform"/>
+</SearchPlugin>
rename from browser/base/content/test/general/test_bug959531.html
rename to browser/base/content/test/about/test_bug959531.html
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -6,17 +6,16 @@
 ###############################################################################
 
 [DEFAULT]
 support-files =
   POSTSearchEngine.xml
   alltabslistener.html
   app_bug575561.html
   app_subframe_bug575561.html
-  aboutHome_content_script.js
   audio.ogg
   browser_bug479408_sample.html
   browser_bug678392-1.html
   browser_bug678392-2.html
   browser_bug970746.xhtml
   browser_registerProtocolHandler_notification.html
   browser_star_hsts.sjs
   browser_tab_dragdrop2_frame1.xul
@@ -44,18 +43,16 @@ support-files =
   file_bug970276_favicon2.ico
   file_documentnavigation_frameset.html
   file_double_close_tab.html
   file_favicon_change.html
   file_favicon_change_not_in_document.html
   file_fullscreen-window-open.html
   file_with_link_to_http.html
   head.js
-  healthreport_pingData.js
-  healthreport_testRemoteCommands.html
   moz.png
   navigating_window_with_download.html
   offlineQuotaNotification.cacheManifest
   offlineQuotaNotification.html
   page_style_sample.html
   pinning_headers.sjs
   ssl_error_reports.sjs
   print_postdata.sjs
@@ -63,17 +60,16 @@ support-files =
   searchSuggestionEngine.xml
   searchSuggestionEngine2.xml
   subtst_contextmenu.html
   subtst_contextmenu_input.html
   subtst_contextmenu_xul.xul
   test_bug462673.html
   test_bug628179.html
   test_bug839103.html
-  test_bug959531.html
   test_process_flags_chrome.html
   title_test.svg
   unknownContentType_file.pif
   unknownContentType_file.pif^headers^
   video.ogg
   web_video.html
   web_video1.ogv
   web_video1.ogv^headers^
@@ -87,32 +83,16 @@ support-files =
   !/toolkit/mozapps/extensions/test/xpinstall/installtrigger.html
   !/toolkit/mozapps/extensions/test/xpinstall/redirect.sjs
   !/toolkit/mozapps/extensions/test/xpinstall/restartless-unsigned.xpi
   !/toolkit/mozapps/extensions/test/xpinstall/restartless.xpi
   !/toolkit/mozapps/extensions/test/xpinstall/theme.xpi
   !/toolkit/mozapps/extensions/test/xpinstall/slowinstall.sjs
 
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
-[browser_aboutCertError.js]
-# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
-[browser_aboutNetError.js]
-# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
-[browser_aboutSupport.js]
-# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
-[browser_aboutSupport_newtab_security_state.js]
-# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
-[browser_aboutHealthReport.js]
-skip-if = os == "linux" # Bug 924307
-# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
-[browser_aboutHome.js]
-skip-if = true # Bug 1374537
-# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
-[browser_aboutHome_wrapsCorrectly.js]
-# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_addKeywordSearch.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_alltabslistener.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_audioTabIcon.js]
 tags = audiochannel
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_backButtonFitts.js]
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -355,94 +355,16 @@ function promiseHistoryClearedState(aURI
         callbackDone();
       });
     });
 
   });
 }
 
 /**
- * Waits for the next top-level document load in the current browser.  The URI
- * of the document is compared against aExpectedURL.  The load is then stopped
- * before it actually starts.
- *
- * @param aExpectedURL
- *        The URL of the document that is expected to load.
- * @param aStopFromProgressListener
- *        Whether to cancel the load directly from the progress listener. Defaults to true.
- *        If you're using this method to avoid hitting the network, you want the default (true).
- *        However, the browser UI will behave differently for loads stopped directly from
- *        the progress listener (effectively in the middle of a call to loadURI) and so there
- *        are cases where you may want to avoid stopping the load directly from within the
- *        progress listener callback.
- * @return promise
- */
-function waitForDocLoadAndStopIt(aExpectedURL, aBrowser = gBrowser.selectedBrowser, aStopFromProgressListener = true) {
-  function content_script(contentStopFromProgressListener) {
-    let { interfaces: Ci, utils: Cu } = Components;
-    Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-    let wp = docShell.QueryInterface(Ci.nsIWebProgress);
-
-    function stopContent(now, uri) {
-      if (now) {
-        /* Hammer time. */
-        content.stop();
-
-        /* Let the parent know we're done. */
-        sendAsyncMessage("Test:WaitForDocLoadAndStopIt", { uri });
-      } else {
-        setTimeout(stopContent.bind(null, true, uri), 0);
-      }
-    }
-
-    let progressListener = {
-      onStateChange(webProgress, req, flags, status) {
-        dump("waitForDocLoadAndStopIt: onStateChange " + flags.toString(16) + ": " + req.name + "\n");
-
-        if (webProgress.isTopLevel &&
-            flags & Ci.nsIWebProgressListener.STATE_START) {
-          wp.removeProgressListener(progressListener);
-
-          let chan = req.QueryInterface(Ci.nsIChannel);
-          dump(`waitForDocLoadAndStopIt: Document start: ${chan.URI.spec}\n`);
-
-          stopContent(contentStopFromProgressListener, chan.originalURI.spec);
-        }
-      },
-      QueryInterface: XPCOMUtils.generateQI(["nsISupportsWeakReference"])
-    };
-    wp.addProgressListener(progressListener, wp.NOTIFY_STATE_WINDOW);
-
-    /**
-     * As |this| is undefined and we can't extend |docShell|, adding an unload
-     * event handler is the easiest way to ensure the weakly referenced
-     * progress listener is kept alive as long as necessary.
-     */
-    addEventListener("unload", function() {
-      try {
-        wp.removeProgressListener(progressListener);
-      } catch (e) { /* Will most likely fail. */ }
-    });
-  }
-
-  return new Promise((resolve, reject) => {
-    function complete({ data }) {
-      is(data.uri, aExpectedURL, "waitForDocLoadAndStopIt: The expected URL was loaded");
-      mm.removeMessageListener("Test:WaitForDocLoadAndStopIt", complete);
-      resolve();
-    }
-
-    let mm = aBrowser.messageManager;
-    mm.loadFrameScript("data:,(" + content_script.toString() + ")(" + aStopFromProgressListener + ");", true);
-    mm.addMessageListener("Test:WaitForDocLoadAndStopIt", complete);
-    info("waitForDocLoadAndStopIt: Waiting for URL: " + aExpectedURL);
-  });
-}
-
-/**
  * Waits for the next load to complete in any browser or the given browser.
  * If a <tabbrowser> is given it waits for a load in any of its browsers.
  *
  * @return promise
  */
 function waitForDocLoadComplete(aBrowser = gBrowser) {
   return new Promise(resolve => {
     let listener = {
@@ -824,12 +746,8 @@ function getCertExceptionDialog(aLocatio
 
       if (childDoc.location.href == aLocation) {
         return childDoc;
       }
     }
   }
   return undefined;
 }
-
-function promiseDisableOnboardingTours() {
-  return SpecialPowers.pushPrefEnv({set: [["browser.onboarding.enabled", false]]});
-}