Bug 821091 - Add a pref to Marionette to cause it use force-local: true, r=mdas, a=test-only
authorJonathan Griffin <jgriffin@mozilla.com>
Wed, 12 Dec 2012 18:04:49 -0800
changeset 115879 aac5a6c4024cbe0b205b8b8b9a44d39d4336e21d
parent 115878 531eb76b7ab6c842e61faa7425c8d9c29732b280
child 115880 40e47d029f77bdbe7aae4c9595be937f1f999c4a
push id24028
push useremorley@mozilla.com
push dateThu, 13 Dec 2012 15:56:02 +0000
treeherderautoland@9db79b97abbb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmdas, test-only
bugs821091
milestone20.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 821091 - Add a pref to Marionette to cause it use force-local: true, r=mdas, a=test-only
testing/marionette/components/marionettecomponent.js
--- a/testing/marionette/components/marionettecomponent.js
+++ b/testing/marionette/components/marionettecomponent.js
@@ -5,16 +5,17 @@
 const {Constructor: CC, classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 const MARIONETTE_CONTRACTID = "@mozilla.org/marionette;1";
 const MARIONETTE_CID = Components.ID("{786a1369-dca5-4adc-8486-33d23c88010a}");
 const DEBUGGER_ENABLED_PREF = 'devtools.debugger.remote-enabled';
 const MARIONETTE_ENABLED_PREF = 'marionette.defaultPrefs.enabled';
 const MARIONETTE_LOADEARLY_PREF = 'marionette.loadearly';
 const DEBUGGER_FORCELOCAL_PREF = 'devtools.debugger.force-local';
+const MARIONETTE_FORCELOCAL_PREF = 'marionette.force-local';
 
 const ServerSocket = CC("@mozilla.org/network/server-socket;1",
                         "nsIServerSocket",
                         "init");
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
@@ -80,17 +81,23 @@ MarionetteComponent.prototype = {
       case "system-message-listener-ready":
         this.logger.info("marionette initializing at system-message-listener-ready");
         observerService.removeObserver(this, "system-message-listener-ready");
 
         try {
           this.original_forcelocal = Services.prefs.getBoolPref(DEBUGGER_FORCELOCAL_PREF);
         }
         catch(e) {}
-        Services.prefs.setBoolPref(DEBUGGER_FORCELOCAL_PREF, false);
+
+        let marionette_forcelocal = false;
+        try {
+          marionette_forcelocal = Services.prefs.getBoolPref(MARIONETTE_FORCELOCAL_PREF);
+        }
+        catch(e) {}
+        Services.prefs.setBoolPref(DEBUGGER_FORCELOCAL_PREF, marionette_forcelocal);
 
         // See bug 800138.  Because the first socket that opens with
         // force-local=false fails, we open a dummy socket that will fail.
         // This allows the following attempt by Marionette to open a socket
         // to succeed.
         let insaneSacrificialGoat = new ServerSocket(666, false, 4);
         insaneSacrificialGoat.asyncListen(this);