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

Commit

Permalink
bug 859952 - B2GDesktopInstance should clone the gaia profile by defa…
Browse files Browse the repository at this point in the history
…ult. r=ahal
  • Loading branch information
luser committed Jan 7, 2015
1 parent 553402d commit 4f3be31
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions testing/marionette/client/marionette/geckoinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,22 @@ def restart(self, prefs=None, clean=True):
self.start()

class B2GDesktopInstance(GeckoInstance):
def __init__(self, **kwargs):
super(B2GDesktopInstance, self).__init__(**kwargs)
def __init__(self, host, port, bin, **kwargs):
# Pass a profile and change the binary to -bin so that
# the built-in gaia profile doesn't get touched.
if kwargs.get('profile', None) is None:
# GeckoInstance.start will clone the profile.
kwargs['profile'] = os.path.join(os.path.dirname(bin),
'gaia',
'profile')
if '-bin' not in os.path.basename(bin):
if bin.endswith('.exe'):
newbin = bin[:-len('.exe')] + '-bin.exe'
else:
newbin = bin + '-bin'
if os.path.exists(newbin):
bin = newbin
super(B2GDesktopInstance, self).__init__(host, port, bin, **kwargs)
if not self.prefs:
self.prefs = {}
self.prefs["focusmanager.testmode"] = True
Expand Down

0 comments on commit 4f3be31

Please sign in to comment.