From 956f5a6d41fd1c5393cee6b716b986888f414ec0 Mon Sep 17 00:00:00 2001 From: Edgar Chen Date: Fri, 21 Aug 2015 10:41:55 +0800 Subject: [PATCH] Bug 1197078 - Send result of emulator command in JSON format. f=ato r=dburns --- testing/marionette/driver/marionette_driver/marionette.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/marionette/driver/marionette_driver/marionette.py b/testing/marionette/driver/marionette_driver/marionette.py index 439c07d5b354..5f7b997479fb 100644 --- a/testing/marionette/driver/marionette_driver/marionette.py +++ b/testing/marionette/driver/marionette_driver/marionette.py @@ -723,7 +723,7 @@ def _emulator_cmd(self, id, cmd): return self._send_emulator_result(id, result) def _emulator_shell(self, id, args): - if not self.emulator: + if not isinstance(args, list) or not self.emulator: raise errors.MarionetteException( "No emulator in this test to run shell command against") buf = StringIO.StringIO() @@ -733,9 +733,9 @@ def _emulator_shell(self, id, args): return self._send_emulator_result(id, result) def _send_emulator_result(self, id, result): - return self.client.send({"name": "emulatorCmdResult", - "id": id, - "result": result}) + return self.client.send(json.dumps({"name": "emulatorCmdResult", + "id": id, + "result": result})) def _handle_error(self, resp): if self.protocol == 1: