Bug 1371576 - Replace %(server)s in modified preferences with empty string. draft
authorHenrik Skupin <mail@hskupin.info>
Wed, 09 Aug 2017 14:32:57 +0200
changeset 643305 2c6241ba3faf325b8f4979418ed4bbce662c169f
parent 643173 4c5fbf49376351679dcc49f4cff26c3c2e055ccc
child 643306 e59d5978883983ac06d6f46c9e9e707d2d13f044
push id73059
push userbmo:hskupin@gmail.com
push dateWed, 09 Aug 2017 16:01:17 +0000
bugs1371576
milestone57.0a1
Bug 1371576 - Replace %(server)s in modified preferences with empty string. With Marionette tests running no component in Firefox should try to contact a remote address. By using %(server)s and not replacing it with localhost, Firefox would still try to resolve the host. By using an empty string we can make sure that no remote address gets hit at all. MozReview-Commit-ID: BTvnFZGfj80
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
@@ -102,18 +102,18 @@ lazy_static! {
         // Disable the UI tour
         ("browser.uitour.enabled", Pref::new(false)),
 
         // 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.about.reportUrl", Pref::new("")),
+        ("datareporting.healthreport.documentServerURI", Pref::new("")),
         ("datareporting.healthreport.logging.consoleEnabled", Pref::new(false)),
         ("datareporting.healthreport.service.enabled", Pref::new(false)),
         ("datareporting.healthreport.service.firstRun", Pref::new(false)),
         ("datareporting.healthreport.uploadEnabled", Pref::new(false)),
         ("datareporting.policy.dataSubmissionEnabled", Pref::new(false)),
         ("datareporting.policy.dataSubmissionPolicyAccepted", Pref::new(false)),
         ("datareporting.policy.dataSubmissionPolicyBypassNotification", Pref::new(true)),
 
@@ -142,17 +142,17 @@ lazy_static! {
         ("extensions.installDistroAddons", Pref::new(false)),
         ("extensions.showMismatchUI", Pref::new(false)),
 
         // Turn off extension updates so they do not bother tests
         ("extensions.update.enabled", Pref::new(false)),
         ("extensions.update.notifyUser", Pref::new(false)),
 
         // Make sure opening about:addons will not hit the network
-        ("extensions.webservice.discoverURL", Pref::new("http://%(server)s/dummy/discoveryURL")),
+        ("extensions.webservice.discoverURL", Pref::new("")),
 
         // Allow the application to have focus even it runs in the
         // background
         ("focusmanager.testmode", Pref::new(true)),
 
         // Disable useragent updates
         ("general.useragent.updates.enabled", Pref::new(false)),
 
@@ -181,32 +181,32 @@ lazy_static! {
         // Disable speculative connections so they are not reported as
         // leaking when they are hanging around
         ("network.http.speculative-parallel-limit", Pref::new(0)),
 
         // Do not automatically switch between offline and online
         ("network.manage-offline-status", Pref::new(false)),
 
         // Make sure SNTP requests do not hit the network
-        ("network.sntp.pools", Pref::new("%(server)s")),
+        ("network.sntp.pools", Pref::new("")),
 
         // Disable Flash.  The plugin container it is run in is
         // causing problems when quitting Firefox from geckodriver,
         // c.f. https://github.com/mozilla/geckodriver/issues/225.
         ("plugin.state.flash", Pref::new(0)),
 
         // Local documents have access to all other local docments,
         // including directory listings.
         ("security.fileuri.strict_origin_policy", Pref::new(false)),
 
         // Tests don't wait for the notification button security delay
         ("security.notification_enable_delay", Pref::new(0)),
 
         // Ensure blocklist updates don't hit the network
-        ("services.settings.server", Pref::new("http://%(server)s/dummy/blocklist/")),
+        ("services.settings.server", Pref::new("")),
 
         // Do not automatically fill sign-in forms with known usernames
         // and passwords
         ("signon.autofillForms", Pref::new(false)),
 
         // Disable password capture, so that tests that include forms
         // are not influenced by the presence of the persistent doorhanger
         // notification
@@ -215,11 +215,11 @@ lazy_static! {
         // Disable first run pages
         ("startup.homepage_welcome_url", Pref::new("about:blank")),
         ("startup.homepage_welcome_url.additional", Pref::new("")),
 
         // Prevent starting into safe mode after application crashes
         ("toolkit.startup.max_resumed_crashes", Pref::new(-1)),
 
         // We want to collect telemetry, but we don't want to send in the results
-        ("toolkit.telemetry.server", Pref::new("https://%(server)s/dummy/telemetry/")),
+        ("toolkit.telemetry.server", Pref::new("")),
     ];
 }
--- a/testing/marionette/client/marionette_driver/geckoinstance.py
+++ b/testing/marionette/client/marionette_driver/geckoinstance.py
@@ -21,18 +21,18 @@ class GeckoInstance(object):
         # This is to accommodate the fact that test environments tends to be slower
         # than production environments (with the b2g emulator being the slowest of them
         # all), resulting in the production timeout value sometimes being exceeded
         # and causing false-positive test failures. See bug 1176798, bug 1177018,
         # bug 1210465.
         "apz.content_response_timeout": 60000,
 
         # Do not send Firefox health reports to the production server
-        "datareporting.healthreport.documentServerURI": "http://%(server)s/dummy/healthreport/",
-        "datareporting.healthreport.about.reportUrl": "http://%(server)s/dummy/abouthealthreport/",
+        "datareporting.healthreport.documentServerURI": "",
+        "datareporting.healthreport.about.reportUrl": "",
 
         # Do not show datareporting policy notifications which can interfer with tests
         "datareporting.policy.dataSubmissionPolicyBypassNotification": True,
 
         "dom.ipc.reportProcessHangs": False,
 
         # No slow script dialogs
         "dom.max_chrome_script_run_time": 0,
@@ -48,17 +48,17 @@ class GeckoInstance(object):
         "extensions.getAddons.cache.enabled": False,
         # Disable intalling any distribution add-ons
         "extensions.installDistroAddons": False,
         "extensions.showMismatchUI": False,
         # Turn off extension updates so they don't bother tests
         "extensions.update.enabled": False,
         "extensions.update.notifyUser": False,
         # Make sure opening about:addons won"t hit the network
-        "extensions.webservice.discoverURL": "http://%(server)s/dummy/discoveryURL",
+        "extensions.webservice.discoverURL": "",
 
         # Allow the application to have focus even it runs in the background
         "focusmanager.testmode": True,
 
         # Disable useragent updates
         "general.useragent.updates.enabled": False,
 
         # Always use network provider for geolocation tests
@@ -85,33 +85,33 @@ class GeckoInstance(object):
         # Do not prompt for temporary redirects
         "network.http.prompt-temp-redirect": False,
         # Disable speculative connections so they aren"t reported as leaking when they"re
         # hanging around
         "network.http.speculative-parallel-limit": 0,
         # Do not automatically switch between offline and online
         "network.manage-offline-status": False,
         # Make sure SNTP requests don't hit the network
-        "network.sntp.pools": "%(server)s",
+        "network.sntp.pools": "",
 
         # Tests don't wait for the notification button security delay
         "security.notification_enable_delay": 0,
 
         # Ensure blocklist updates don't hit the network
-        "services.settings.server": "http://%(server)s/dummy/blocklist/",
+        "services.settings.server": "",
 
         # Disable password capture, so that tests that include forms aren"t
         # influenced by the presence of the persistent doorhanger notification
         "signon.rememberSignons": False,
 
         # Prevent starting into safe mode after application crashes
         "toolkit.startup.max_resumed_crashes": -1,
 
         # We want to collect telemetry, but we don't want to send in the results
-        "toolkit.telemetry.server": "https://%(server)s/dummy/telemetry/",
+        "toolkit.telemetry.server": "",
 
         # Enabling the support for File object creation in the content process.
         "dom.file.createInChild": True,
     }
 
     def __init__(self, host=None, port=None, bin=None, profile=None, addons=None,
                  app_args=None, symbols_path=None, gecko_log=None, prefs=None,
                  workspace=None, verbose=0, headless=False):
--- a/testing/marionette/server.js
+++ b/testing/marionette/server.js
@@ -160,22 +160,20 @@ const RECOMMENDED_PREFS = new Map([
   // Disable the UI tour.
   //
   // Should be set in profile.
   ["browser.uitour.enabled", false],
 
   // Do not show datareporting policy notifications which can
   // interfere with tests
   [
-    "datareporting.healthreport.about.reportUrl",
-    "http://%(server)s/dummy/abouthealthreport/",
+    "datareporting.healthreport.about.reportUrl", "",
   ],
   [
-    "datareporting.healthreport.documentServerURI",
-    "http://%(server)s/dummy/healthreport/",
+    "datareporting.healthreport.documentServerURI", "",
   ],
   ["datareporting.healthreport.logging.consoleEnabled", false],
   ["datareporting.healthreport.service.enabled", false],
   ["datareporting.healthreport.service.firstRun", false],
   ["datareporting.healthreport.uploadEnabled", false],
   ["datareporting.policy.dataSubmissionEnabled", false],
   ["datareporting.policy.dataSubmissionPolicyAccepted", false],
   ["datareporting.policy.dataSubmissionPolicyBypassNotification", true],
@@ -209,18 +207,17 @@ const RECOMMENDED_PREFS = new Map([
   ["extensions.showMismatchUI", false],
 
   // Turn off extension updates so they do not bother tests
   ["extensions.update.enabled", false],
   ["extensions.update.notifyUser", false],
 
   // Make sure opening about:addons will not hit the network
   [
-    "extensions.webservice.discoverURL",
-    "http://%(server)s/dummy/discoveryURL",
+    "extensions.webservice.discoverURL", "",
   ],
 
   // Allow the application to have focus even it runs in the background
   ["focusmanager.testmode", true],
 
   // Disable useragent updates
   ["general.useragent.updates.enabled", false],
 
@@ -243,27 +240,27 @@ const RECOMMENDED_PREFS = new Map([
   // Disable speculative connections so they are not reported as leaking
   // when they are hanging around
   ["network.http.speculative-parallel-limit", 0],
 
   // Do not automatically switch between offline and online
   ["network.manage-offline-status", false],
 
   // Make sure SNTP requests do not hit the network
-  ["network.sntp.pools", "%(server)s"],
+  ["network.sntp.pools", ""],
 
   // Local documents have access to all other local documents,
   // including directory listings
   ["security.fileuri.strict_origin_policy", false],
 
   // Tests do not wait for the notification button security delay
   ["security.notification_enable_delay", 0],
 
   // Ensure blocklist updates do not hit the network
-  ["services.settings.server", "http://%(server)s/dummy/blocklist/"],
+  ["services.settings.server", ""],
 
   // Do not automatically fill sign-in forms with known usernames and
   // passwords
   ["signon.autofillForms", false],
 
   // Disable password capture, so that tests that include forms are not
   // influenced by the presence of the persistent doorhanger notification
   ["signon.rememberSignons", false],