Bug 1042161 - Set dummy URL for GMP addon updates for xpcshell tests. r=jmaher
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Fri, 08 Aug 2014 17:46:25 +0200
changeset 212912 bfab1b77459d11efabd1e2ffdcdb19cec848e9eb
parent 212911 1a9b83ef50a0578c4c557db2d13e7a4ff5336e8e
child 212913 17408fd769e2e48d063e45c794e3da7df01ea265
push idunknown
push userunknown
push dateunknown
reviewersjmaher
bugs1042161
milestone34.0a1
Bug 1042161 - Set dummy URL for GMP addon updates for xpcshell tests. r=jmaher
testing/xpcshell/head.js
--- a/testing/xpcshell/head.js
+++ b/testing/xpcshell/head.js
@@ -1337,8 +1337,18 @@ try {
     // Always use network provider for geolocation tests
     // so we bypass the OSX dialog raised by the corelocation provider
     let prefs = Components.classes["@mozilla.org/preferences-service;1"]
       .getService(Components.interfaces.nsIPrefBranch);
 
     prefs.setBoolPref("geo.provider.testing", true);
   }
 } catch (e) { }
+
+// We need to avoid hitting the network with certain components.
+try {
+  if (runningInParent) {
+    let prefs = Components.classes["@mozilla.org/preferences-service;1"]
+      .getService(Components.interfaces.nsIPrefBranch);
+
+    prefs.setCharPref("media.gmp-manager.url.override", "http://%(server)s/dummy.xml");
+  }
+} catch (e) { }