Index: chrome/test/pyautolib/pyauto.py |
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py |
index 054e51ebd636eb9de59723685b6a7e52adf61334..d762bc08329e5804338169a96735b287626e162b 100644 |
--- a/chrome/test/pyautolib/pyauto.py |
+++ b/chrome/test/pyautolib/pyauto.py |
@@ -255,7 +255,10 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): |
@staticmethod |
def Kill(pid): |
- """Terminate the given pid.""" |
+ """Terminate the given pid. |
+ |
+ If the pid refers to a renderer, use KillRendererProcess instead. |
+ """ |
if PyUITest.IsWin(): |
subprocess.call(['taskkill.exe', '/T', '/F', '/PID', str(pid)]) |
else: |
@@ -1966,6 +1969,24 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): |
if self.GetNTPThumbnailIndex(thumbnail) == -1: |
raise NTPThumbnailNotShownError() |
+ def KillRendererProcess(self, pid): |
+ """Kills the given renderer process. |
+ |
+ This will return only after the browser has received notice of the renderer |
+ close. |
+ |
+ Args: |
+ pid: the process id of the renderer to kill |
+ |
+ Raises: |
+ pyauto_errors.JSONInterfaceError if the automation call returns an error. |
+ """ |
+ cmd_dict = { |
+ 'command': 'KillRendererProcess', |
+ 'pid': pid |
+ } |
+ return self._GetResultFromJSONRequest(cmd_dict) |
+ |
class PyUITestSuite(pyautolib.PyUITestSuiteBase, unittest.TestSuite): |
"""Base TestSuite for PyAuto UI tests.""" |