diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 10:21:58 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 10:21:58 +0000 |
commit | d94809fec7601aaf46166eeeeb096bc578bf5bbe (patch) | |
tree | ea412fba15c3a088afa4cc40540f1b5710dd3b2a /chrome/test/pyautolib | |
parent | 472643af74d6a6f0efd541234217e22d4b2cc720 (diff) | |
download | chromium_src-d94809fec7601aaf46166eeeeb096bc578bf5bbe.zip chromium_src-d94809fec7601aaf46166eeeeb096bc578bf5bbe.tar.gz chromium_src-d94809fec7601aaf46166eeeeb096bc578bf5bbe.tar.bz2 |
GTTF: Get rid of IsBrowserRunning. It is inherently racy
and should not be used. Where needed, explicitly wait
for the browser to shut down.
The problem with IsBrowserRunning is the raciness: the browser may be alive when you call IsBrowserRunning, and crash right after the call completes. There are also various ways of implementing IsBrowserRunning. We could do a waitpid on it (that was the previously used solution), but then if the browser did exit we'd be losing information about its exit code, whether it was killed by a signal, and so on (we'd have to plumb this information from base/process_util through IsBrowserRunning to UI test infrastructure; that'd be rather complicated and error prone). The solution the code was using just before this removal was to send a dummy IPC message to the browser. But then the browser might be shutting down and no longer receiving IPC messages, but the process itself could still be running.
So the simplest way to deal with the problem is to get the browser's exit code in UITest::TearDown. This allows us to detect crashes on shutdown in a non-racy way, which is very important. And then if the browser dies in the middle of a test, the next IPC call to it will fail, and the shutdown check in UITest::TearDown will also fail.
BUG=none
Review URL: http://codereview.chromium.org/7039044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib')
-rw-r--r-- | chrome/test/pyautolib/pyautolib.i | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/chrome/test/pyautolib/pyautolib.i b/chrome/test/pyautolib/pyautolib.i index 6784694..b132130 100644 --- a/chrome/test/pyautolib/pyautolib.i +++ b/chrome/test/pyautolib/pyautolib.i @@ -362,11 +362,6 @@ class PyUITestBase { int tab_index=0); // Misc methods - %feature("docstring", "Determine if the browser is running. " - "Returns False if user closed the window or if the browser died") - IsBrowserRunning; - bool IsBrowserRunning(); - %feature("docstring", "Install an extension from the given file. The file " "must be specified with an absolute path. Returns the extension ID " "if successfully installed and loaded. Otherwise, returns the empty " |