Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Unified Diff: chrome/test/pyautolib/pyauto.py

Issue 5755003: Fix pyauto flakiness by waiting for notification that the renderer process' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« chrome/test/functional/browser.py ('K') | « chrome/test/functional/stress.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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."""
« chrome/test/functional/browser.py ('K') | « chrome/test/functional/stress.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698