summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-11 12:36:33 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-11 12:36:33 +0000
commitbb7f4d3e98d48d9930502dcbf9b8eaf6f58f174d (patch)
tree67b06bb785172129dc0d0c6730b555f4edd27031 /chrome/browser
parent7153d83d9dd74251ee98d6d4d0794b84a374f990 (diff)
downloadchromium_src-bb7f4d3e98d48d9930502dcbf9b8eaf6f58f174d.zip
chromium_src-bb7f4d3e98d48d9930502dcbf9b8eaf6f58f174d.tar.gz
chromium_src-bb7f4d3e98d48d9930502dcbf9b8eaf6f58f174d.tar.bz2
Remove sleep_timeout_ms and fix all the callers.
(This was a TODO for phajdan.jr). BUG=None TEST=trybots Review URL: http://codereview.chromium.org/6187002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71038 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/download/download_uitest.cc3
-rw-r--r--chrome/browser/errorpage_uitest.cc5
-rw-r--r--chrome/browser/history/redirect_uitest.cc7
-rw-r--r--chrome/browser/images_uitest.cc5
-rw-r--r--chrome/browser/media_uitest.cc5
-rw-r--r--chrome/browser/metrics/metrics_service_uitest.cc5
-rw-r--r--chrome/browser/process_singleton_linux_uitest.cc9
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc5
-rw-r--r--chrome/browser/ui/tests/browser_uitest.cc9
9 files changed, 31 insertions, 22 deletions
diff --git a/chrome/browser/download/download_uitest.cc b/chrome/browser/download/download_uitest.cc
index 71a2329..39e1ac2 100644
--- a/chrome/browser/download/download_uitest.cc
+++ b/chrome/browser/download/download_uitest.cc
@@ -10,6 +10,7 @@
#include "base/path_service.h"
#include "base/string_util.h"
#include "base/test/test_file_util.h"
+#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
#include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h"
@@ -153,7 +154,7 @@ TEST_F(DownloadTest, FLAKY_NoDownload) {
WaitUntilTabCount(1);
// Wait to see if the file will be downloaded.
- base::PlatformThread::Sleep(sleep_timeout_ms());
+ base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
EXPECT_FALSE(file_util::PathExists(file_path));
if (file_util::PathExists(file_path))
diff --git a/chrome/browser/errorpage_uitest.cc b/chrome/browser/errorpage_uitest.cc
index 51b9754..7f10083 100644
--- a/chrome/browser/errorpage_uitest.cc
+++ b/chrome/browser/errorpage_uitest.cc
@@ -1,8 +1,9 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/string_util.h"
+#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/ui/ui_test.h"
@@ -16,7 +17,7 @@ class ErrorPageTest : public UITest {
for (int i = 0; i < 10; ++i) {
if (GetActiveTabTitle() == title)
return true;
- base::PlatformThread::Sleep(sleep_timeout_ms());
+ base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
}
EXPECT_EQ(title, GetActiveTabTitle());
return false;
diff --git a/chrome/browser/history/redirect_uitest.cc b/chrome/browser/history/redirect_uitest.cc
index 9d2c35a..f755469 100644
--- a/chrome/browser/history/redirect_uitest.cc
+++ b/chrome/browser/history/redirect_uitest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,6 +12,7 @@
#include "base/scoped_temp_dir.h"
#include "base/string_util.h"
#include "base/string16.h"
+#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/ui/view_ids.h"
@@ -210,7 +211,7 @@ TEST_F(RedirectTest, ClientServerServer) {
NavigateToURL(first_url);
for (int i = 0; i < 10; ++i) {
- base::PlatformThread::Sleep(sleep_timeout_ms());
+ base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
scoped_refptr<TabProxy> tab_proxy(GetActiveTab());
ASSERT_TRUE(tab_proxy.get());
ASSERT_TRUE(tab_proxy->GetRedirectsFrom(first_url, &redirects));
@@ -316,7 +317,7 @@ TEST_F(RedirectTest,
std::wstring final_url_title = UTF8ToWide("Title Of Awesomeness");
// Wait till the final page has been loaded.
for (int i = 0; i < 10; ++i) {
- base::PlatformThread::Sleep(sleep_timeout_ms());
+ base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
scoped_refptr<TabProxy> tab_proxy(GetActiveTab());
ASSERT_TRUE(tab_proxy.get());
ASSERT_TRUE(tab_proxy->GetTabTitle(&tab_title));
diff --git a/chrome/browser/images_uitest.cc b/chrome/browser/images_uitest.cc
index 400ac86..5c36e40 100644
--- a/chrome/browser/images_uitest.cc
+++ b/chrome/browser/images_uitest.cc
@@ -1,9 +1,10 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/basictypes.h"
#include "base/file_path.h"
+#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
#include "net/base/net_util.h"
#include "chrome/test/ui/ui_test.h"
@@ -16,7 +17,7 @@ TEST_F(ImagesTest, AnimatedGIFs) {
NavigateToURL(net::FilePathToFileURL(test_file));
// Let the GIFs fully animate.
- base::PlatformThread::Sleep(sleep_timeout_ms());
+ base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
std::wstring page_title = L"animated gif test";
EXPECT_EQ(page_title, GetActiveTabTitle());
diff --git a/chrome/browser/media_uitest.cc b/chrome/browser/media_uitest.cc
index 0d1bc26..f05bc10 100644
--- a/chrome/browser/media_uitest.cc
+++ b/chrome/browser/media_uitest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,6 +6,7 @@
#include "base/basictypes.h"
#include "base/file_path.h"
#include "base/string_util.h"
+#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/test_launcher_utils.h"
@@ -46,7 +47,7 @@ class MediaTest : public UITest {
const std::wstring kFailed = L"FAILED";
const std::wstring kError = L"ERROR";
for (int i = 0; i < 10; ++i) {
- base::PlatformThread::Sleep(sleep_timeout_ms());
+ base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
const std::wstring& title = GetActiveTabTitle();
if (title == kPlaying || title == kFailed ||
StartsWith(title, kError, true))
diff --git a/chrome/browser/metrics/metrics_service_uitest.cc b/chrome/browser/metrics/metrics_service_uitest.cc
index 24ea726..3d3b0d2 100644
--- a/chrome/browser/metrics/metrics_service_uitest.cc
+++ b/chrome/browser/metrics/metrics_service_uitest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,6 +10,7 @@
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
+#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/pref_service_mock_builder.h"
@@ -99,7 +100,7 @@ TEST_F(MetricsServiceTest, CrashRenderers) {
}
// Give the browser a chance to notice the crashed tab.
- base::PlatformThread::Sleep(sleep_timeout_ms());
+ base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
QuitBrowser();
diff --git a/chrome/browser/process_singleton_linux_uitest.cc b/chrome/browser/process_singleton_linux_uitest.cc
index 6abcefe..7678770 100644
--- a/chrome/browser/process_singleton_linux_uitest.cc
+++ b/chrome/browser/process_singleton_linux_uitest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,6 +14,7 @@
#include "base/eintr_wrapper.h"
#include "base/path_service.h"
#include "base/string_util.h"
+#include "base/test/test_timeouts.h"
#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/ui/browser.h"
@@ -170,7 +171,7 @@ TEST_F(ProcessSingletonLinuxTest, NotifyOtherProcessFailure) {
NotifyOtherProcess(url, action_timeout_ms()));
// Wait for a while to make sure the browser process is actually killed.
- EXPECT_FALSE(CrashAwareSleep(sleep_timeout_ms()));
+ EXPECT_FALSE(CrashAwareSleep(TestTimeouts::action_timeout_ms()));
}
// Test that we don't kill ourselves by accident if a lockfile with the same pid
@@ -224,7 +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.
- EXPECT_FALSE(CrashAwareSleep(sleep_timeout_ms()));
+ 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()));
@@ -246,7 +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.
- EXPECT_FALSE(CrashAwareSleep(sleep_timeout_ms()));
+ 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()));
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
index 6cd6822..5271595 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,6 +9,7 @@
#include "base/file_path.h"
#include "base/path_service.h"
#include "base/string_util.h"
+#include "base/test/test_timeouts.h"
#include "chrome/browser/net/url_request_failed_dns_job.h"
#include "chrome/browser/net/url_request_mock_http_job.h"
#include "chrome/common/url_constants.h"
@@ -215,7 +216,7 @@ TEST_F(ResourceDispatcherTest, CrossSiteAfterCrash) {
#endif
ASSERT_TRUE(tab->NavigateToURLAsync(GURL(chrome::kAboutCrashURL)));
// Wait for browser to notice the renderer crash.
- base::PlatformThread::Sleep(sleep_timeout_ms());
+ base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
// Navigate to a new cross-site page. The browser should not wait around for
// the old renderer's on{before}unload handlers to run.
diff --git a/chrome/browser/ui/tests/browser_uitest.cc b/chrome/browser/ui/tests/browser_uitest.cc
index 680a86a..3b9c92c 100644
--- a/chrome/browser/ui/tests/browser_uitest.cc
+++ b/chrome/browser/ui/tests/browser_uitest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -9,6 +9,7 @@
#include "base/string_util.h"
#include "base/sys_info.h"
#include "base/test/test_file_util.h"
+#include "base/test/test_timeouts.h"
#include "base/values.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/platform_util.h"
@@ -113,7 +114,7 @@ TEST_F(BrowserTest, NullOpenerRedirectForksProcess) {
// Make sure that a new tab has been created and that we have a new renderer
// process for it.
ASSERT_TRUE(tab->NavigateToURLAsync(fork_url));
- PlatformThread::Sleep(sleep_timeout_ms());
+ PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
ASSERT_EQ(orig_process_count + 1, GetBrowserProcessCount());
int new_tab_count = -1;
ASSERT_TRUE(window->GetTabCount(&new_tab_count));
@@ -166,7 +167,7 @@ TEST_F(BrowserTest, MAYBE_OtherRedirectsDontForkProcess) {
// Make sure that a new tab but not new process has been created.
ASSERT_TRUE(tab->NavigateToURLAsync(dont_fork_url));
- base::PlatformThread::Sleep(sleep_timeout_ms());
+ base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
ASSERT_EQ(orig_process_count, GetBrowserProcessCount());
int new_tab_count = -1;
ASSERT_TRUE(window->GetTabCount(&new_tab_count));
@@ -181,7 +182,7 @@ TEST_F(BrowserTest, MAYBE_OtherRedirectsDontForkProcess) {
// Make sure that no new process has been created.
ASSERT_TRUE(tab->NavigateToURLAsync(dont_fork_url2));
- base::PlatformThread::Sleep(sleep_timeout_ms());
+ base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms());
ASSERT_EQ(orig_process_count, GetBrowserProcessCount());
}