Bug 1034044 - Remove dependency on Marionette session from get_device_manager. r=jgriffin

This commit is contained in:
Dave Hunt 2014-07-15 12:12:00 +02:00
parent cd9022a952
commit d2c5ea5656

View File

@ -40,8 +40,10 @@ class B2GTestCaseMixin(object):
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