mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 726867 - DeviceManagerSUT's getProcessList is identical to code in DeviceManager. r=jmaher
This commit is contained in:
parent
b67d94eb5d
commit
afcfb958bd
@ -529,39 +529,6 @@ class DeviceManagerSUT(DeviceManager):
|
||||
if self.fireProcess(cmdline, failIfRunning) is None:
|
||||
return None
|
||||
return outputFile
|
||||
|
||||
# iterates process list and returns pid if exists, otherwise None
|
||||
# external function
|
||||
# returns:
|
||||
# success: pid
|
||||
# failure: None
|
||||
def processExist(self, appname):
|
||||
pid = None
|
||||
|
||||
#filter out extra spaces
|
||||
parts = filter(lambda x: x != '', appname.split(' '))
|
||||
appname = ' '.join(parts)
|
||||
|
||||
#filter out the quoted env string if it exists
|
||||
#ex: '"name=value;name2=value2;etc=..." process args' -> 'process args'
|
||||
parts = appname.split('"')
|
||||
if (len(parts) > 2):
|
||||
appname = ' '.join(parts[2:]).strip()
|
||||
|
||||
pieces = appname.split(' ')
|
||||
parts = pieces[0].split('/')
|
||||
app = parts[-1]
|
||||
|
||||
procList = self.getProcessList()
|
||||
if (procList == []):
|
||||
return None
|
||||
|
||||
for proc in procList:
|
||||
procName = proc[1].split('/')[-1]
|
||||
if (procName == app):
|
||||
pid = proc[0]
|
||||
break
|
||||
return pid
|
||||
|
||||
# external function
|
||||
# returns:
|
||||
|
Loading…
Reference in New Issue
Block a user