Backout 9252522aab90, r=bustage
authorJonathan Griffin <jgriffin@mozilla.com>
Fri, 30 Nov 2012 12:54:00 -0800
changeset 114652 d6529aa771822b00c8875e2d69c7cfa0fc8f1e8b
parent 114651 8f4db7426eee982cdcc73e9821f139f8046edc91
child 114653 fd22236ffb15153cf28db0cf328098522d243425
push id23926
push userryanvm@gmail.com
push dateSat, 01 Dec 2012 15:27:30 +0000
treeherdermozilla-central@ecdf0e332f17 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
milestone20.0a1
backs out9252522aab902d063792370a7be66a538391f361
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 9252522aab90, r=bustage
layout/tools/reftest/runreftestb2g.py
testing/marionette/client/marionette/emulator.py
testing/marionette/components/marionettecomponent.js
testing/mochitest/runtestsb2g.py
--- a/layout/tools/reftest/runreftestb2g.py
+++ b/layout/tools/reftest/runreftestb2g.py
@@ -401,17 +401,16 @@ user_pref("dom.mozBrowserFramesEnabled",
 user_pref("dom.mozBrowserFramesWhitelist","app://system.gaiamobile.org");\n
 user_pref("network.dns.localDomains","app://system.gaiamobile.org");\n
 user_pref("font.size.inflation.emPerLine", 0);
 user_pref("font.size.inflation.minTwips", 0);
 user_pref("reftest.browser.iframe.enabled", true);
 user_pref("reftest.remote", true);
 user_pref("reftest.uri", "%s");
 user_pref("toolkit.telemetry.prompted", true);
-user_pref("marionette.loadearly", true);
 """ % reftestlist)
 
         #workaround for jsreftests.
         if getattr(options, 'enablePrivilege', False):
             fhandle.write("""
 user_pref("capability.principal.codebase.p2.granted", "UniversalXPConnect");
 user_pref("capability.principal.codebase.p2.id", "http://%s:%s");
 """ % (options.remoteWebServer, options.httpPort))
--- a/testing/marionette/client/marionette/emulator.py
+++ b/testing/marionette/client/marionette/emulator.py
@@ -325,21 +325,21 @@ waitFor(
             online, offline = self._get_adb_devices()
         self.port = int(list(online)[0])
 
         self.dm = devicemanagerADB.DeviceManagerADB(adbPath=self.adb,
                                                     deviceSerial='emulator-%d' % self.port)
 
     def add_prefs_to_profile(self, prefs=None):
         if not prefs:
-            prefs = ['user_pref("marionette.loadearly", true);']
+            prefs = ["user_pref('marionette.loadearly', true);"]
         local_user_js = tempfile.mktemp(prefix='localuserjs')
         self.dm.getFile(self.remote_user_js, local_user_js)
         with open(local_user_js, 'a') as f:
-            f.write('%s\n' % '\n'.join(prefs))
+            f.write('/n'.join(prefs))
         self.dm.pushFile(local_user_js, self.remote_user_js)
 
     def start(self):
         self._check_for_b2g()
         self.start_adb()
 
         qemu_args = self.args[:]
         if self.copy_userdata:
@@ -374,27 +374,33 @@ waitFor(
 
         if self.logcat_dir:
             self.save_logcat()
 
         # setup DNS fix for networking
         self._run_adb(['shell', 'setprop', 'net.dns1', '10.0.2.3'])
 
     def setup(self, marionette, gecko_path=None, load_early=False):
+        # Wait for the system-message-listener-ready event, otherwise
+        # Bad Things happen.
+        self.wait_for_system_message(marionette)
+
         if gecko_path:
             if load_early:
                 # Inject prefs into the profile now, since we have to restart
                 # B2G after installing a new gecko anyway.
                 self.add_prefs_to_profile()
             self.install_gecko(gecko_path, marionette)
         elif load_early:
             self.add_prefs_to_profile()
             self.restart_b2g()
 
-        if load_early:
+        #if load_early:
+        # Temporarily enable this always until part 2 of bug 815807 lands
+        if True:
             # If we're loading early, we have to wait for the
             # system-message-listener-ready event again after restarting B2G.
             # If we're not loading early, we skip this because Marionette
             # doesn't load until after this event has fired.
             self.wait_for_system_message(marionette)
 
     def restart_b2g(self):
         print 'restarting B2G'
--- a/testing/marionette/components/marionettecomponent.js
+++ b/testing/marionette/components/marionettecomponent.js
@@ -3,17 +3,16 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const {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';
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource:///modules/services-common/log4moz.js");
 
 function MarionetteComponent() {
   this._loaded = false;
@@ -35,44 +34,31 @@ MarionetteComponent.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
   _xpcom_categories: [{category: "profile-after-change", service: true}],
 
   observe: function mc_observe(aSubject, aTopic, aData) {
     let observerService = Services.obs;
     switch (aTopic) {
       case "profile-after-change":
         let enabled = false;
-        let loadearly = false;
         try {
           enabled = Services.prefs.getBoolPref(MARIONETTE_ENABLED_PREF);
-          loadearly = Services.prefs.getBoolPref(MARIONETTE_LOADEARLY_PREF);
         } catch(e) {}
         if (enabled) {
-          this.logger.info("marionette enabled, loadearly: " + loadearly);
+          this.logger.info("marionette enabled");
 
           //add observers
-          if (loadearly) {
-            observerService.addObserver(this, "final-ui-startup", false);
-          }
-          else {
-            observerService.addObserver(this, "system-message-listener-ready", false);
-          }
+          observerService.addObserver(this, "final-ui-startup", false);
           observerService.addObserver(this, "xpcom-shutdown", false);
         }
         else {
           this.logger.info("marionette not enabled");
         }
         break;
-      case "system-message-listener-ready":
-        this.logger.info("marionette initializing at system-message-listener-ready");
-        observerService.removeObserver(this, "system-message-listener-ready");
-        this.init();
-        break;
       case "final-ui-startup":
-        this.logger.info("marionette initializing at final-ui-startup");
         observerService.removeObserver(this, "final-ui-startup");
         this.init();
         break;
       case "xpcom-shutdown":
         observerService.removeObserver(this, "xpcom-shutdown");
         this.uninit();
         break;
     }
--- a/testing/mochitest/runtestsb2g.py
+++ b/testing/mochitest/runtestsb2g.py
@@ -424,17 +424,16 @@ container.src = '%s';
         f.write("""
 user_pref("browser.homescreenURL","app://test-container.gaiamobile.org/index.html");
 user_pref("browser.manifestURL","app://test-container.gaiamobile.org/manifest.webapp");
 user_pref("dom.mozBrowserFramesEnabled", true);
 user_pref("dom.ipc.tabs.disabled", false);
 user_pref("dom.ipc.browser_frames.oop_by_default", false);
 user_pref("dom.mozBrowserFramesWhitelist","app://test-container.gaiamobile.org,http://mochi.test:8888");
 user_pref("network.dns.localDomains","app://test-container.gaiamobile.org");
-user_pref("marionette.loadearly", true);
 """)
         f.close()
 
         # Copy the profile to the device.
         self._dm._checkCmdAs(['shell', 'rm', '-r', self.remoteProfile])
         try:
             self._dm.pushDir(options.profilePath, self.remoteProfile)
         except devicemanager.DMError: