Bug 1399628 - Disable Shield extension in Marionette and geckodriver. draft
authorHenrik Skupin <mail@hskupin.info>
Thu, 14 Sep 2017 21:03:40 +0200
changeset 665455 a2cd602d0f86fd09f8982e984e34b50a22c42ffb
parent 664736 dd6b788f149763c4014c27f2fe1a1d13228bda82
child 731779 454e69ad5fe34fcf1aa617178b3e334b2287a4ce
push id80059
push userbmo:hskupin@gmail.com
push dateFri, 15 Sep 2017 12:38:45 +0000
bugs1399628
milestone57.0a1
Bug 1399628 - Disable Shield extension in Marionette and geckodriver. Shield experiments interfer with core features of Firefox which can cause tests run via Marionette or geckodriver to fail. Resetting the API URL will make sure that no experiments can be downloaded. MozReview-Commit-ID: HnE49jfnen7
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); 79] = [
+    pub static ref DEFAULT: [(&'static str, Pref); 80] = [
         // 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
@@ -141,16 +141,20 @@ lazy_static! {
         // don't block add-ons for e10s
         ("extensions.e10sBlocksEnabling", Pref::new(false)),
 
         // Disable metadata caching for installed add-ons by default
         ("extensions.getAddons.cache.enabled", Pref::new(false)),
 
         // Disable intalling any distribution extensions or add-ons
         ("extensions.installDistroAddons", Pref::new(false)),
+
+        // Make sure Shield doesn't hit the network.
+        ("extensions.shield-recipe-client.api_url", Pref::new("")),
+
         ("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")),
--- a/testing/marionette/client/marionette_driver/geckoinstance.py
+++ b/testing/marionette/client/marionette_driver/geckoinstance.py
@@ -43,16 +43,18 @@ class GeckoInstance(object):
         "extensions.autoDisableScopes": 0,
         "extensions.enabledScopes": 5,
         # don't block add-ons for e10s
         "extensions.e10sBlocksEnabling": False,
         # Disable metadata caching for installed add-ons by default
         "extensions.getAddons.cache.enabled": False,
         # Disable intalling any distribution add-ons
         "extensions.installDistroAddons": False,
+        # Make sure Shield doesn't hit the network.
+        "extensions.shield-recipe-client.api_url": "",
         "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",
 
         # Allow the application to have focus even it runs in the background
--- a/testing/marionette/server.js
+++ b/testing/marionette/server.js
@@ -201,19 +201,23 @@ const RECOMMENDED_PREFS = new Map([
   ["extensions.enabledScopes", 5],
 
   // Do not block add-ons for e10s
   ["extensions.e10sBlocksEnabling", false],
 
   // Disable metadata caching for installed add-ons by default
   ["extensions.getAddons.cache.enabled", false],
 
-  // Disable intalling any distribution extensions or add-ons.
+  // Disable installing any distribution extensions or add-ons.
   // Should be set in profile.
   ["extensions.installDistroAddons", false],
+
+  // Make sure Shield doesn't hit the network.
+  ["extensions.shield-recipe-client.api_url", ""],
+
   ["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
   [