summaryrefslogtreecommitdiffstats
path: root/chrome/browser/unload_uitest.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-27 17:48:18 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-27 17:48:18 +0000
commit12420450793f711862ff08bb9e4b0eb3aada8595 (patch)
treee5cd0507fcd573d6488183b9a8c10382ecf27897 /chrome/browser/unload_uitest.cc
parenta947ae340d0054c5f62ecb3ff760e83ba2041c0d (diff)
downloadchromium_src-12420450793f711862ff08bb9e4b0eb3aada8595.zip
chromium_src-12420450793f711862ff08bb9e4b0eb3aada8595.tar.gz
chromium_src-12420450793f711862ff08bb9e4b0eb3aada8595.tar.bz2
Speculatively roll back r14549 and r14508. The chrome browser
process is pegged at 100% cpu after ui_tests has exited. Seeing if this is the cause. Will re-roll forward if it's not. TBR=estade Review URL: http://codereview.chromium.org/100047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14620 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/unload_uitest.cc')
-rw-r--r--chrome/browser/unload_uitest.cc24
1 files changed, 7 insertions, 17 deletions
diff --git a/chrome/browser/unload_uitest.cc b/chrome/browser/unload_uitest.cc
index 316857b..a2e3369 100644
--- a/chrome/browser/unload_uitest.cc
+++ b/chrome/browser/unload_uitest.cc
@@ -3,13 +3,13 @@
// found in the LICENSE file.
#include "base/file_util.h"
-#include "base/platform_thread.h"
+
#include "chrome/browser/automation/url_request_mock_http_job.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/message_box_flags.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/ui/ui_test.h"
+#include "chrome/views/window/dialog_delegate.h"
#include "net/url_request/url_request_unittest.h"
const std::string NOLISTENERS_HTML =
@@ -96,7 +96,7 @@ class UnloadTest : public UITest {
int max_wait_time = 5000;
while (max_wait_time > 0) {
max_wait_time -= kCheckDelayMs;
- PlatformThread::Sleep(kCheckDelayMs);
+ Sleep(kCheckDelayMs);
if (!IsBrowserRunning())
break;
}
@@ -107,7 +107,7 @@ class UnloadTest : public UITest {
int max_wait_time = 5000;
while (max_wait_time > 0) {
max_wait_time -= kCheckDelayMs;
- PlatformThread::Sleep(kCheckDelayMs);
+ Sleep(kCheckDelayMs);
if (expected_title == GetActiveTabTitle())
break;
}
@@ -136,10 +136,10 @@ class UnloadTest : public UITest {
void NavigateToNolistenersFileTwiceAsync() {
// TODO(ojan): We hit a DCHECK in RenderViewHost::OnMsgShouldCloseACK
// if we don't sleep here.
- PlatformThread::Sleep(400);
+ Sleep(400);
NavigateToURLAsync(
URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
- PlatformThread::Sleep(400);
+ Sleep(400);
NavigateToURL(
URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
@@ -155,26 +155,17 @@ class UnloadTest : public UITest {
}
void ClickModalDialogButton(MessageBoxFlags::DialogButton button) {
-#if defined(OS_WIN) || defined(OS_LINUX)
bool modal_dialog_showing = false;
MessageBoxFlags::DialogButton available_buttons;
EXPECT_TRUE(automation()->WaitForAppModalDialog(3000));
EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing,
&available_buttons));
ASSERT_TRUE(modal_dialog_showing);
- EXPECT_TRUE((button & available_buttons) != 0);
+ EXPECT_TRUE((button & available_buttons) != NULL);
EXPECT_TRUE(automation()->ClickAppModalDialogButton(button));
-#else
- // TODO(port): port this function if and when the tests that use it are
- // enabled (currently they are not being run even on windows).
- NOTIMPLEMENTED();
-#endif
}
};
-// TODO(port): these tests fail on linux because they leave a renderer process
-// lying around which holds onto the user data directory.
-#if defined(OS_WIN)
// Navigate to a page with an infinite unload handler.
// Then two two async crosssite requests to ensure
// we don't get confused and think we're closing the tab.
@@ -230,7 +221,6 @@ TEST_F(UnloadTest, CrossSiteInfiniteBeforeUnloadSync) {
NavigateToNolistenersFileTwice();
ASSERT_TRUE(IsBrowserRunning());
}
-#endif
// Tests closing the browser on a page with no unload listeners registered.
TEST_F(UnloadTest, BrowserCloseNoUnloadListeners) {