mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 797639 - Part 3: Fix Marionette client / server loading and parsing. r=jgriffin
This commit is contained in:
parent
64ce7860dd
commit
f0e7ce6951
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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}");
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user