From 77aeb58b6793591d7822511bace92461431b6772 Mon Sep 17 00:00:00 2001 From: "huanr@chromium.org" Date: Tue, 26 May 2009 21:46:35 +0000 Subject: Revert r16903 that causes reliability crash spike. Review URL: http://codereview.chromium.org/113865 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16925 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/ui/ui_test.cc | 24 ++++++------------------ chrome/test/ui/ui_test.h | 8 -------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 6d8cc03..85e97b0 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -413,12 +413,9 @@ void UITest::QuitBrowser() { #if !defined(OS_LINUX) for (BrowserVector::iterator iter = browsers.begin(); iter != browsers.end(); ++iter) { - bool application_closed = false; - CloseBrowserWithTimeout(*iter, &application_closed, - action_timeout_ms(), NULL); + // Use ApplyAccelerator since it doesn't wait + (*iter)->ApplyAccelerator(IDC_CLOSE_WINDOW); delete (*iter); - if (application_closed) - break; } #endif @@ -747,31 +744,22 @@ void UITest::CloseBrowserAsync(BrowserProxy* browser) const { bool UITest::CloseBrowser(BrowserProxy* browser, bool* application_closed) const { - return CloseBrowserWithTimeout(browser, application_closed, - base::kNoTimeout, NULL); -} - -bool UITest::CloseBrowserWithTimeout(BrowserProxy* browser, - bool* application_closed, - int timeout_ms, - bool* is_timeout) const { DCHECK(application_closed); if (!browser->is_valid() || !browser->handle()) return false; bool result = true; - bool succeeded = server_->SendWithTimeout( - new AutomationMsg_CloseBrowser( - 0, browser->handle(), &result, application_closed), - timeout_ms, is_timeout); + bool succeeded = server_->Send(new AutomationMsg_CloseBrowser( + 0, browser->handle(), &result, application_closed)); if (!succeeded) return false; if (*application_closed) { // Let's wait until the process dies (if it is not gone already). - result = base::WaitForSingleProcess(process_, timeout_ms); + bool success = base::WaitForSingleProcess(process_, base::kNoTimeout); + DCHECK(success); } return result; diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 1196760..543f1fd 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -201,14 +201,6 @@ class UITest : public testing::Test { // after the browser process has terminated. bool CloseBrowser(BrowserProxy* browser, bool* application_closed) const; - // Closes the specified browser. Returns true if the browser was closed. - // If this was the last browser window, |application_closed| is set to true - // and the function returns after the browser process has terminated. - // This call blocks on closing until specified timeout_ms is reached. If - // timed out, it returns false with is_timeout set to true. - bool CloseBrowserWithTimeout(BrowserProxy* browser, bool* application_closed, - int timeout_ms, bool* is_timeout) const; - // Prints numerical information to stdout in a controlled format, for // post-processing. |measurement| is a description of the quantity being // measured, e.g. "vm_peak"; |modifier| is provided as a convenience and -- cgit v1.1