diff --git a/testing/marionette/client/marionette/emulator.py b/testing/marionette/client/marionette/emulator.py index 074f61608ed8..b5c5fcbcd1cb 100644 --- a/testing/marionette/client/marionette/emulator.py +++ b/testing/marionette/client/marionette/emulator.py @@ -538,7 +538,7 @@ window.addEventListener('mozbrowserloadend', function loaded(aEvent) { sock.connect(('localhost', self.marionette_port)) data = sock.recv(16) sock.close() - if '"from"' in data: + if ':' in data: return True except: import traceback diff --git a/testing/marionette/client/marionette/marionette.py b/testing/marionette/client/marionette/marionette.py index 3e9e2d6b047e..7c36643e62cb 100644 --- a/testing/marionette/client/marionette/marionette.py +++ b/testing/marionette/client/marionette/marionette.py @@ -586,7 +586,7 @@ class Marionette(object): sock.connect((self.host, self.port)) data = sock.recv(16) sock.close() - if '"from"' in data: + if ':' in data: time.sleep(5) return True except socket.error: diff --git a/testing/marionette/components/marionettecomponent.js b/testing/marionette/components/marionettecomponent.js index acf32a94051e..ce6d415fc54a 100644 --- a/testing/marionette/components/marionettecomponent.js +++ b/testing/marionette/components/marionettecomponent.js @@ -6,6 +6,7 @@ this.CC = Components.Constructor; this.Cc = Components.classes; this.Ci = Components.interfaces; this.Cu = Components.utils; +this.Cr = Components.results; const MARIONETTE_CONTRACTID = "@mozilla.org/marionette;1"; const MARIONETTE_CID = Components.ID("{786a1369-dca5-4adc-8486-33d23c88010a}"); diff --git a/testing/marionette/marionette-server.js b/testing/marionette/marionette-server.js index d2c59907bd08..d6f64a3b31c6 100644 --- a/testing/marionette/marionette-server.js +++ b/testing/marionette/marionette-server.js @@ -38,7 +38,7 @@ let appName = Services.appinfo.name; let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}); let DevToolsUtils = devtools.require("devtools/toolkit/DevToolsUtils.js"); this.DevToolsUtils = DevToolsUtils; -loader.loadSubScript("resource://gre/modules/devtools/server/transport.js"); +loader.loadSubScript("resource://gre/modules/devtools/transport/transport.js"); let bypassOffline = false; let qemu = "0"; @@ -202,7 +202,7 @@ MarionetteServerConnection.prototype = { */ sendAsync: function MDA_sendAsync(name, values, commandId, ignoreFailure) { let success = true; - if (values instanceof Object && commandId) { + if (commandId) { values.command_id = commandId; } if (this.curBrowser.frameManager.currentRemoteFrame !== null) { diff --git a/testing/marionette/transport/marionette_transport/transport.py b/testing/marionette/transport/marionette_transport/transport.py index 41da169d881b..e28d16ff83a0 100644 --- a/testing/marionette/transport/marionette_transport/transport.py +++ b/testing/marionette/transport/marionette_transport/transport.py @@ -45,11 +45,13 @@ class MarionetteTransport(object): """ assert(self.sock) response = self.sock.recv(10) + initial_size = len(response) sep = response.find(':') length = response[0:sep] if length != '': response = response[sep + 1:] - response += self._recv_n_bytes(int(length) + 1 + len(length) - 10) + remaining_size = int(length) + 1 + len(length) - initial_size + response += self._recv_n_bytes(remaining_size) return json.loads(response) else: raise IOError(self.connection_lost_msg)