bug 859952 - B2GDesktopInstance should clone the gaia profile by default. r=ahal

--HG--
extra : rebase_source : 33fb2b38166139f6ba64ab66e0738c751a682152
This commit is contained in:
Ted Mielczarek 2015-01-07 14:17:05 -05:00
parent d8ee02caf2
commit 96e0d6a7dd

View File

@ -149,8 +149,22 @@ class GeckoInstance(object):
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