Bug 1149347 - Don't initialize SpecialPowers unconditionally, r=ato
authorJonathan Griffin <jgriffin@mozilla.com>
Tue, 31 Mar 2015 09:44:02 -0700
changeset 236884 01992671dc61f7adcdaa2067ffc05f0b1ed127fa
parent 236883 1012996e7a49049116039bbe6ac8817cf65e85be
child 236885 83af1139a6d335c38edb1409f30c2d5c5196ed0b
push id28521
push userryanvm@gmail.com
push dateWed, 01 Apr 2015 16:35:21 +0000
treeherdermozilla-central@e5b72a8edb82 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1149347
milestone40.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 1149347 - Don't initialize SpecialPowers unconditionally, r=ato
testing/marionette/server.js
--- a/testing/marionette/server.js
+++ b/testing/marionette/server.js
@@ -49,30 +49,16 @@ this.MarionetteServer = function(port, f
   this.port = port;
   this.forceLocal = forceLocal;
   this.conns = {};
   this.nextConnId = 0;
   this.alive = false;
 };
 
 /**
- * Initialises the Marionette server by loading in the special powers
- * which is required to provide some automation-only features.
- */
-MarionetteServer.prototype.init = function() {
-  // SpecialPowers requires insecure automation-only features that we put behind a pref
-  Services.prefs.setBoolPref(SPECIAL_POWERS_PREF, true);
-  let specialpowers = {};
-  loader.loadSubScript(
-    "chrome://specialpowers/content/SpecialPowersObserver.js", specialpowers);
-  specialpowers.specialPowersObserver = new specialpowers.SpecialPowersObserver();
-  specialpowers.specialPowersObserver.init();
-};
-
-/**
  * Function that takes an Emulator and produces a GeckoDriver.
  *
  * Determines application name and device type to initialise the driver
  * with.  Also bypasses offline status if the device is a qemu or panda
  * type device.
  *
  * @return {GeckoDriver}
  *     A driver instance.
@@ -110,17 +96,16 @@ MarionetteServer.prototype.driverFactory
 
   return new GeckoDriver(appName, device, emulator);
 };
 
 MarionetteServer.prototype.start = function() {
   if (this.alive) {
     return;
   }
-  this.init();
   let flags = Ci.nsIServerSocket.KeepWhenOffline;
   if (this.forceLocal) {
     flags |= Ci.nsIServerSocket.LoopbackOnly;
   }
   this.listener = new ServerSocket(this.port, flags, 0);
   this.listener.asyncListen(this);
   this.alive = true;
 };