diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-05 18:05:34 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-05 18:05:34 +0000 |
commit | c7c9809761404ceb4d8357010ac77674f2d22990 (patch) | |
tree | 2d4aaaff1cf37a2434796a123a87405164dbfa8e /chrome/browser/process_singleton_linux_uitest.cc | |
parent | 3e43b3a8b107a57a311a6f8c279c3683917e587c (diff) | |
download | chromium_src-c7c9809761404ceb4d8357010ac77674f2d22990.zip chromium_src-c7c9809761404ceb4d8357010ac77674f2d22990.tar.gz chromium_src-c7c9809761404ceb4d8357010ac77674f2d22990.tar.bz2 |
Revert 80472 - GTTF: Detect browser crashes on shutdown in UI tests.Previously the automation framework could miss a browsercrash during shutdown on POSIX (on Windows there iscrash_service.exe that should catch all crashes).This change makes the automation framework avoid losinginformation about the browser process' exit status(CrashAwareSleep), and fixes a bug in base::WaitForExitCodeWithTimeout(which on POSIX never reported the process has been signaled).Finally, it makes the automation framework use WaitForExitCodeWithTimeoutinstead of WaitForSingleProcess. This way we can get the exit statusinformation in an accurate and cross-platform way.To avoid trying to close the same process handle twice (it's only an issue on Windows) I've changed WaitForExitCodeWithTimeout not to close the passed handle. It's only used in few places and I think this CL fixes all of them.I've tested this change locally on Mac with a UI test that SIGKILLs the browser.Before this change the test passed (it shouldn't), and after this changethe test failed with an information that the browser has not exited cleanly.BUG=56644Review URL: http://codereview.chromium.org/6689014
TBR=phajdan.jr@chromium.org
[----------] 1 test from MultipartResponseUITest
[ RUN ] MultipartResponseUITest.SingleVisit
[3538:3538:0405/104633:11326126024137:ERROR:process_util_posix.cc(108)] Received signal 11
base::debug::StackTrace::StackTrace() [0xcd194a]
base::(anonymous namespace)::StackDumpSignalHandler() [0xcb0e5a]
0x2b835e391100
AutomationProxy::GetBrowserWindowCount() [0x2055e86]
ProxyLauncher::IsBrowserRunning() [0xc3f1a2]
ProxyLauncher::QuitBrowser() [0xc454b3]
ProxyLauncher::CloseBrowserAndServer() [0xc472d6]
UITestBase::TearDown() [0xc50d54]
UITest::TearDown() [0xc51260]
testing::TestInfo::Run() [0xe8de78]
testing::TestCase::Run() [0xe8df35]
testing::internal::UnitTestImpl::RunAllTests() [0xe8f6e7]
testing::internal::HandleSehExceptionsInMethodIfSupported<>() [0xe804d5]
testing::internal::HandleExceptionsInMethodIfSupported<>() [0xe8ba92]
testing::UnitTest::Run() [0xe8badb]
base::TestSuite::Run() [0x212c26d]
main [0xc48e41]
0x2b835e37d1c4
0x42fec9
Review URL: http://codereview.chromium.org/6794056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80488 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_singleton_linux_uitest.cc')
-rw-r--r-- | chrome/browser/process_singleton_linux_uitest.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/chrome/browser/process_singleton_linux_uitest.cc b/chrome/browser/process_singleton_linux_uitest.cc index 2129ed0..6606eb0 100644 --- a/chrome/browser/process_singleton_linux_uitest.cc +++ b/chrome/browser/process_singleton_linux_uitest.cc @@ -171,10 +171,7 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessFailure) { NotifyOtherProcess(url, TestTimeouts::action_timeout_ms())); // Wait for a while to make sure the browser process is actually killed. - int exit_code = 0; - ASSERT_TRUE(launcher_->WaitForBrowserProcessToQuit( - TestTimeouts::action_max_timeout_ms(), &exit_code)); - EXPECT_EQ(-1, exit_code); // Expect unclean shutdown. + EXPECT_FALSE(CrashAwareSleep(TestTimeouts::action_timeout_ms())); } // Test that we don't kill ourselves by accident if a lockfile with the same pid @@ -228,10 +225,7 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessDifferingHost) { // Kill the browser process, so that it does not respond on the socket. kill(pid, SIGKILL); // Wait for a while to make sure the browser process is actually killed. - int exit_code = 0; - ASSERT_TRUE(launcher_->WaitForBrowserProcessToQuit( - TestTimeouts::action_max_timeout_ms(), &exit_code)); - EXPECT_EQ(-1, exit_code); // Expect unclean shutdown. + EXPECT_FALSE(CrashAwareSleep(TestTimeouts::action_timeout_ms())); EXPECT_EQ(0, unlink(lock_path_.value().c_str())); EXPECT_EQ(0, symlink("FAKEFOOHOST-1234", lock_path_.value().c_str())); @@ -253,10 +247,7 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessOrCreate_DifferingHost) { // Kill the browser process, so that it does not respond on the socket. kill(pid, SIGKILL); // Wait for a while to make sure the browser process is actually killed. - int exit_code = 0; - ASSERT_TRUE(launcher_->WaitForBrowserProcessToQuit( - TestTimeouts::action_max_timeout_ms(), &exit_code)); - EXPECT_EQ(-1, exit_code); // Expect unclean shutdown. + EXPECT_FALSE(CrashAwareSleep(TestTimeouts::action_timeout_ms())); EXPECT_EQ(0, unlink(lock_path_.value().c_str())); EXPECT_EQ(0, symlink("FAKEFOOHOST-1234", lock_path_.value().c_str())); |