From 2e70a34fa03f21e744b807c8b0d4e42d0c928c4d Mon Sep 17 00:00:00 2001 From: Jonathan Griffin Date: Fri, 30 Nov 2012 12:54:00 -0800 Subject: [PATCH] Backout 9252522aab90, r=bustage --- layout/tools/reftest/runreftestb2g.py | 1 - .../marionette/client/marionette/emulator.py | 12 +++++++++--- .../components/marionettecomponent.js | 18 ++---------------- testing/mochitest/runtestsb2g.py | 1 - 4 files changed, 11 insertions(+), 21 deletions(-) diff --git a/layout/tools/reftest/runreftestb2g.py b/layout/tools/reftest/runreftestb2g.py index 2a4a63cc3ae..d0d5c4a60ba 100644 --- a/layout/tools/reftest/runreftestb2g.py +++ b/layout/tools/reftest/runreftestb2g.py @@ -406,7 +406,6 @@ 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. diff --git a/testing/marionette/client/marionette/emulator.py b/testing/marionette/client/marionette/emulator.py index f73fea22f65..e32ca91fb26 100644 --- a/testing/marionette/client/marionette/emulator.py +++ b/testing/marionette/client/marionette/emulator.py @@ -330,11 +330,11 @@ waitFor( 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): @@ -379,6 +379,10 @@ waitFor( 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 @@ -389,7 +393,9 @@ waitFor( 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 diff --git a/testing/marionette/components/marionettecomponent.js b/testing/marionette/components/marionettecomponent.js index c8d46ae7031..92ff97b1652 100644 --- a/testing/marionette/components/marionettecomponent.js +++ b/testing/marionette/components/marionettecomponent.js @@ -8,7 +8,6 @@ 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"); @@ -40,34 +39,21 @@ MarionetteComponent.prototype = { 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; diff --git a/testing/mochitest/runtestsb2g.py b/testing/mochitest/runtestsb2g.py index 5a96456295c..63e8992e25a 100644 --- a/testing/mochitest/runtestsb2g.py +++ b/testing/mochitest/runtestsb2g.py @@ -429,7 +429,6 @@ 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()