From 50418a12fcdffd44b438886f26aed17ba2652d46 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Thu, 12 Dec 2013 06:35:00 -0800 Subject: [PATCH] Bug 948992 - Copy the deviceSerial to ADB's device manager. r=jgriffin --- testing/marionette/client/marionette/runner/base.py | 9 ++++++--- .../marionette/client/marionette/runner/mixins/b2g.py | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/testing/marionette/client/marionette/runner/base.py b/testing/marionette/client/marionette/runner/base.py index 206811ec13e9..b98f4650c314 100644 --- a/testing/marionette/client/marionette/runner/base.py +++ b/testing/marionette/client/marionette/runner/base.py @@ -634,12 +634,14 @@ class BaseMarionetteTestRunner(object): logcat_dir=self.logcat_dir, gecko_path=self.gecko_path, symbols_path=self.symbols_path, - timeout=self.timeout) + timeout=self.timeout, + device_serial=self.device_serial) else: self.marionette = Marionette(host=host, port=int(port), baseurl=self.baseurl, - timeout=self.timeout) + timeout=self.timeout, + device_serial=self.device_serial) elif self.emulator: self.marionette = Marionette.getMarionetteOrExit( emulator=self.emulator, @@ -653,7 +655,8 @@ class BaseMarionetteTestRunner(object): gecko_path=self.gecko_path, symbols_path=self.symbols_path, timeout=self.timeout, - sdcard=self.sdcard) + sdcard=self.sdcard, + device_serial=self.device_serial) else: raise Exception("must specify binary, address or emulator") diff --git a/testing/marionette/client/marionette/runner/mixins/b2g.py b/testing/marionette/client/marionette/runner/mixins/b2g.py index 8cbe388d152c..9a48cf267e9d 100644 --- a/testing/marionette/client/marionette/runner/mixins/b2g.py +++ b/testing/marionette/client/marionette/runner/mixins/b2g.py @@ -12,12 +12,11 @@ class B2GTestCaseMixin(object): def __init__(self, *args, **kwargs): self._device_manager = None - @property - def device_manager(self, *args, **kwargs): + def get_device_manager(self, *args, **kwargs): if not self._device_manager: dm_type = os.environ.get('DM_TRANS', 'adb') if dm_type == 'adb': - self._device_manager = mozdevice.DeviceManagerADB() + self._device_manager = mozdevice.DeviceManagerADB(**kwargs) elif dm_type == 'sut': host = os.environ.get('TEST_DEVICE') if not host: @@ -27,3 +26,6 @@ class B2GTestCaseMixin(object): raise Exception('Unknown device manager type: %s' % dm_type) return self._device_manager + @property + def device_manager(self): + return self.get_device_manager()