зеркало из https://github.com/mozilla/gecko-dev.git
Bug 848124 - instrument b2gautomation to send environment variables to the on device process, r=jgriffin
This commit is contained in:
Родитель
a04b817cbf
Коммит
6a7bc77ca2
|
@ -240,7 +240,7 @@ class B2GRemoteAutomation(Automation):
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
# relaunch b2g inside b2g instance
|
# relaunch b2g inside b2g instance
|
||||||
instance = self.B2GInstance(self._devicemanager)
|
instance = self.B2GInstance(self._devicemanager, env=env)
|
||||||
|
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
|
@ -298,8 +298,9 @@ class B2GRemoteAutomation(Automation):
|
||||||
automation.
|
automation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, dm):
|
def __init__(self, dm, env=None):
|
||||||
self.dm = dm
|
self.dm = dm
|
||||||
|
self.env = env or {}
|
||||||
self.stdout_proc = None
|
self.stdout_proc = None
|
||||||
self.queue = Queue.Queue()
|
self.queue = Queue.Queue()
|
||||||
|
|
||||||
|
@ -311,6 +312,8 @@ class B2GRemoteAutomation(Automation):
|
||||||
if self.dm._deviceSerial:
|
if self.dm._deviceSerial:
|
||||||
cmd.extend(['-s', self.dm._deviceSerial])
|
cmd.extend(['-s', self.dm._deviceSerial])
|
||||||
cmd.append('shell')
|
cmd.append('shell')
|
||||||
|
for k, v in self.env.iteritems():
|
||||||
|
cmd.append("%s=%s" % (k, v))
|
||||||
cmd.append('/system/bin/b2g.sh')
|
cmd.append('/system/bin/b2g.sh')
|
||||||
proc = threading.Thread(target=self._save_stdout_proc, args=(cmd, self.queue))
|
proc = threading.Thread(target=self._save_stdout_proc, args=(cmd, self.queue))
|
||||||
proc.daemon = True
|
proc.daemon = True
|
||||||
|
|
Загрузка…
Ссылка в новой задаче