mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 931078 - add ability to pass signal to dm.killProcess, r=wlach
This commit is contained in:
parent
98ac5d8f72
commit
547119fc65
@ -419,10 +419,13 @@ class DeviceManager(object):
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def killProcess(self, processName, forceKill=False):
|
||||
def killProcess(self, processName, sig=None):
|
||||
"""
|
||||
Kills the process named processName. If forceKill is True, process is
|
||||
killed regardless of state.
|
||||
Kills the process named processName. If sig is not None, process is
|
||||
killed with the specified signal.
|
||||
|
||||
:param processName: path or name of the process to kill
|
||||
:param sig: signal to pass into the kill command (optional)
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
|
@ -374,13 +374,13 @@ class DeviceManagerADB(DeviceManager):
|
||||
self._checkCmd(acmd)
|
||||
return outputFile
|
||||
|
||||
def killProcess(self, appname, forceKill=False):
|
||||
def killProcess(self, appname, sig=None):
|
||||
procs = self.getProcessList()
|
||||
for (pid, name, user) in procs:
|
||||
if name == appname:
|
||||
args = ["shell", "kill"]
|
||||
if forceKill:
|
||||
args.append("-9")
|
||||
if sig:
|
||||
args.append("-%d" % sig)
|
||||
args.append(str(pid))
|
||||
p = self._runCmdAs(args)
|
||||
p.communicate()
|
||||
|
@ -525,9 +525,9 @@ class DeviceManagerSUT(DeviceManager):
|
||||
self.fireProcess(cmdline, failIfRunning)
|
||||
return outputFile
|
||||
|
||||
def killProcess(self, appname, forceKill=False):
|
||||
if forceKill:
|
||||
self._logger.warn("killProcess(): forceKill parameter unsupported on SUT")
|
||||
def killProcess(self, appname, sig=None):
|
||||
if sig:
|
||||
self._logger.warn("killProcess(): sig parameter unsupported on SUT")
|
||||
retries = 0
|
||||
while retries < self.retryLimit:
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user