Merge pull request #819 from bootstraponline/large_json

Fix large JSON
This commit is contained in:
Jonathan Lipps
2013-06-26 17:50:05 -07:00
2 changed files with 15 additions and 6 deletions

View File

@@ -900,16 +900,16 @@ ADB.prototype.checkForSocketReady = function(output) {
this.onSocketReady(null);
}, this));
this.socketClient.setEncoding('utf8');
var oldData = '';
this.socketClient.on('data', _.bind(function(data) {
this.debug("Received command result from bootstrap");
try {
data = JSON.parse(data);
data = JSON.parse(oldData + data);
oldData = '';
} catch (e) {
this.debug("Could not parse JSON from data: " + data);
data = {
status: status.codes.UnknownError.code
, value: "Got a bad response from Android server"
};
logger.info("Stream still not complete, waiting");
oldData += data;
return;
}
if (this.cmdCb) {
var next = this.cmdCb;

View File

@@ -246,3 +246,12 @@ describeWd('unallowed tag names', function(h) {
});
});
});
describeWd('mobile xmlKeyContains', function(h) {
it('should not error on xmlKeyContains', function(done) {
h.driver.execute("mobile: xmlKeyContains", [''], function(err, el) {
should.not.exist(err);
done();
});
});
});