Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Commit

Permalink
Bug 1026151 - Return a default device pixel ratio if we don't have a …
Browse files Browse the repository at this point in the history
…Marionette session. r=wlachance
  • Loading branch information
davehunt committed Jun 16, 2014
1 parent 6d75b5c commit 3e65c3f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/eideticker/eideticker/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,10 @@ def restartB2G(self):
@property
def devicePixelRatio(self):
if not self._devicePixelRatio:
self._devicePixelRatio = self.marionette.execute_script(
'return window.wrappedJSObject.devicePixelRatio;') or 1
return self._devicePixelRatio
if self.marionette and self.marionette.session:
self._devicePixelRatio = self.marionette.execute_script(
'return window.wrappedJSObject.devicePixelRatio;')
return self._devicePixelRatio or 1


class B2GADB(EidetickerB2GMixin, mozdevice.DeviceManagerADB):
Expand Down

0 comments on commit 3e65c3f

Please sign in to comment.