mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1075487 - find b2g pid based on string splitting, r=jgriffin
This commit is contained in:
parent
e2e3e13137
commit
8e53554c0a
@ -26,11 +26,14 @@ def get_dm(marionette=None,**kwargs):
|
||||
|
||||
|
||||
def get_b2g_pid(dm):
|
||||
b2g_output = dm.shellCheckOutput(['b2g-ps'])
|
||||
pid_re = re.compile(r"""b2g[\s]+0[\s]+root\s+([\d]+).*/system/b2g/b2g""")
|
||||
pid = pid_re.match(b2g_output)
|
||||
if pid:
|
||||
return pid.group(1)
|
||||
b2g_output = dm.shellCheckOutput(['b2g-ps']).split('\n')
|
||||
first_line = b2g_output[0].split()
|
||||
app_index = first_line.index('APPLICATION')
|
||||
pid_index = first_line.index('PID')
|
||||
for line in b2g_output:
|
||||
split_line = line.split()
|
||||
if split_line[app_index] == 'b2g':
|
||||
return split_line[pid_index]
|
||||
|
||||
|
||||
class B2GTestCaseMixin(object):
|
||||
|
Loading…
Reference in New Issue
Block a user