Bug 1368034 - Update default values for urlbar searches in Marionette r=whimboo draft
authorIan MacLeod <rubberdonkeysandwich@gmail.com>
Mon, 25 Sep 2017 02:10:47 -0700
changeset 669856 cd0fe8f3437340b1266d161e1cad46bcbcd1a6f6
parent 669596 7e962631ba4298bcefa571008661983d77c3e652
child 733060 f88a5b37f1f697dd27eef625cc91f19b8ccb90a0
push id81437
push userbmo:rubberdonkeysandwich@gmail.com
push dateMon, 25 Sep 2017 12:28:09 +0000
reviewerswhimboo
bugs1368034
milestone58.0a1
Bug 1368034 - Update default values for urlbar searches in Marionette r=whimboo Search suggestions create unneccessary network requests and the suggestions opt-in notification interferes with tests that don't expect it to be there. So, this patch updates the default settings in Marionette to disable both. MozReview-Commit-ID: 8X8SYPq19tj
testing/geckodriver/src/prefs.rs
testing/marionette/client/marionette_driver/geckoinstance.py
testing/marionette/server.js
--- a/testing/geckodriver/src/prefs.rs
+++ b/testing/geckodriver/src/prefs.rs
@@ -1,12 +1,12 @@
 use mozprofile::preferences::Pref;
 
 lazy_static! {
-    pub static ref DEFAULT: [(&'static str, Pref); 80] = [
+    pub static ref DEFAULT: [(&'static str, Pref); 82] = [
         // Disable automatic downloading of new releases
         ("app.update.auto", Pref::new(false)),
 
         // Disable automatically upgrading Firefox
         ("app.update.enabled", Pref::new(false)),
 
         // Increase the APZ content response timeout in tests to 1
         // minute.  This is to accommodate the fact that test environments
@@ -100,16 +100,24 @@ lazy_static! {
         ("browser.tabs.warnOnOpen", Pref::new(false)),
 
         // Disable first run splash page on Windows 10
         ("browser.usedOnWindows10.introURL", Pref::new("")),
 
         // Disable the UI tour
         ("browser.uitour.enabled", Pref::new(false)),
 
+        // Turn off search suggestions in the location bar so as not to trigger
+        // network connections.
+        ("browser.urlbar.suggest.searches", Pref::new(false)),
+
+        // Turn off the location bar search suggestions opt-in.  It interferes with
+        // tests that don't expect it to be there.
+        ("browser.urlbar.userMadeSearchSuggestionsChoice", Pref::new(true)),
+
         // Do not warn on quitting Firefox
         ("browser.warnOnQuit", Pref::new(false)),
 
         // Do not show datareporting policy notifications which can
         // interfere with tests
         ("datareporting.healthreport.about.reportUrl", Pref::new("http://%(server)s/dummy/abouthealthreport/")),
         ("datareporting.healthreport.documentServerURI", Pref::new("http://%(server)s/dummy/healthreport/")),
         ("datareporting.healthreport.logging.consoleEnabled", Pref::new(false)),
--- a/testing/marionette/client/marionette_driver/geckoinstance.py
+++ b/testing/marionette/client/marionette_driver/geckoinstance.py
@@ -470,16 +470,24 @@ class DesktopInstance(GeckoInstance):
         # Do not warn when closing all other open tabs
         "browser.tabs.warnOnCloseOtherTabs": False,
         # Do not warn when multiple tabs will be opened
         "browser.tabs.warnOnOpen": False,
 
         # Disable the UI tour
         "browser.uitour.enabled": False,
 
+        # Turn off search suggestions in the location bar so as not to trigger network
+        # connections.
+        "browser.urlbar.suggest.searches": False,
+
+        # Turn off the location bar search suggestions opt-in.  It interferes with
+        # tests that don't expect it to be there.
+        "browser.urlbar.userMadeSearchSuggestionsChoice": True,
+
         # Disable first-run welcome page
         "startup.homepage_welcome_url": "about:blank",
         "startup.homepage_welcome_url.additional": "",
     }
 
     def __init__(self, *args, **kwargs):
         super(DesktopInstance, self).__init__(*args, **kwargs)
         self.required_prefs.update(DesktopInstance.desktop_prefs)
--- a/testing/marionette/server.js
+++ b/testing/marionette/server.js
@@ -157,16 +157,24 @@ const RECOMMENDED_PREFS = new Map([
   // Disable first run splash page on Windows 10
   ["browser.usedOnWindows10.introURL", ""],
 
   // Disable the UI tour.
   //
   // Should be set in profile.
   ["browser.uitour.enabled", false],
 
+  // Turn off search suggestions in the location bar so as not to trigger
+  // network connections.
+  ["browser.urlbar.suggest.searches", false],
+
+  // Turn off the location bar search suggestions opt-in.  It interferes with
+  // tests that don't expect it to be there.
+  ["browser.urlbar.userMadeSearchSuggestionsChoice", true],
+
   // Do not show datareporting policy notifications which can
   // interfere with tests
   [
     "datareporting.healthreport.about.reportUrl",
     "http://%(server)s/dummy/abouthealthreport/",
   ],
   [
     "datareporting.healthreport.documentServerURI",