Bug 1034044 - Remove dependency on Marionette session from get_device_manager. r=jgriffin
authorDave Hunt <dhunt@mozilla.com>
Tue, 15 Jul 2014 12:12:00 +0200
changeset 215523 b76e4fdff4da163839385dfe64302480080ea6f7
parent 215522 df278df1524f968923d102ae3e91c7e463475a4b
child 215524 52f0f39c88898df6e3fed898becb1c5433d9de11
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs1034044
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1034044 - Remove dependency on Marionette session from get_device_manager. r=jgriffin
testing/marionette/client/marionette/runner/mixins/b2g.py
--- a/testing/marionette/client/marionette/runner/mixins/b2g.py
+++ b/testing/marionette/client/marionette/runner/mixins/b2g.py
@@ -35,18 +35,20 @@ def get_b2g_pid(dm):
 
 class B2GTestCaseMixin(object):
 
     # TODO: add methods like 'restart b2g'
     def __init__(self, *args, **kwargs):
         self._device_manager = None
 
     def get_device_manager(self, *args, **kwargs):
-        capabilities = self.marionette.session_capabilities
-        if not self._device_manager and capabilities['device'] != 'desktop':
+        capabilities = self.marionette.session and \
+            self.marionette.session_capabilities or {}
+        if not self._device_manager and \
+                capabilities.get('device') != 'desktop':
             self._device_manager = get_dm(self.marionette, **kwargs)
         return self._device_manager
 
     @property
     def device_manager(self):
         return self.get_device_manager()