Backout 22f9cf3cc575 (bug 820463) for breaking marionette on a CLOSED TREE
authorEd Morley <emorley@mozilla.com>
Wed, 19 Dec 2012 01:23:00 +0000
changeset 125591 b0a563745fb6
parent 125590 dc08a7e9993a
child 125592 b1ea92a3149d
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs820463
milestone20.0a1
backs out22f9cf3cc575
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
Backout 22f9cf3cc575 (bug 820463) for breaking marionette on a CLOSED TREE
testing/marionette/components/marionettecomponent.js
--- a/testing/marionette/components/marionettecomponent.js
+++ b/testing/marionette/components/marionettecomponent.js
@@ -3,16 +3,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 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");
@@ -51,33 +52,40 @@ MarionetteComponent.prototype = {
   },
 
   observe: function mc_observe(aSubject, aTopic, aData) {
     let observerService = Services.obs;
     switch (aTopic) {
       case "profile-after-change":
         let appName = Services.appinfo.name;
         let enabled = false;
+        let loadearly = appName == 'B2G' ? false : true;
         try {
           enabled = Services.prefs.getBoolPref(MARIONETTE_ENABLED_PREF);
+          loadearly = Services.prefs.getBoolPref(MARIONETTE_LOADEARLY_PREF);
         } catch(e) {}
         if (enabled) {
-          this.logger.info("marionette enabled");
+          this.logger.info("marionette enabled, loadearly: " + loadearly);
 
           //add observers
-          observerService.addObserver(this, "final-ui-startup", false);
+          if (loadearly) {
+            observerService.addObserver(this, "final-ui-startup", false);
+          }
+          else {
+            observerService.addObserver(this, "system-message-listener-ready", false);
+          }
           observerService.addObserver(this, "xpcom-shutdown", false);
         }
         else {
           this.logger.info("marionette not enabled");
         }
         break;
-      case "final-ui-startup":
-        this.logger.info("marionette initializing at " + aTopic);
-        observerService.removeObserver(this, aTopic);
+      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) {}
 
         let marionette_forcelocal = false;
         try {