diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-31 20:02:16 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-31 20:02:16 +0000 |
commit | ce072a7181ea5d58133e33654133236f5d9f5551 (patch) | |
tree | 1b1c903fec3fd27038cd17cb4ae9ca17d3736e40 /chrome/test | |
parent | a8e2058011129cbef38bf89834ee01715556b392 (diff) | |
download | chromium_src-ce072a7181ea5d58133e33654133236f5d9f5551.zip chromium_src-ce072a7181ea5d58133e33654133236f5d9f5551.tar.gz chromium_src-ce072a7181ea5d58133e33654133236f5d9f5551.tar.bz2 |
Move platform_thread to base/threading and put in the base namespace. I left a
stub and "using" declarations in the old location to avoid having to change the
entire project at once.
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/6001010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70342 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
19 files changed, 62 insertions, 52 deletions
diff --git a/chrome/test/automated_ui_tests/automated_ui_test_interactive_test.cc b/chrome/test/automated_ui_tests/automated_ui_test_interactive_test.cc index c4c1eec..df4d33d 100644 --- a/chrome/test/automated_ui_tests/automated_ui_test_interactive_test.cc +++ b/chrome/test/automated_ui_tests/automated_ui_test_interactive_test.cc @@ -1,7 +1,8 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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/threading/platform_thread.h" #include "chrome/test/automated_ui_tests/automated_ui_test_base.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" @@ -11,7 +12,7 @@ TEST_F(AutomatedUITestBase, DragOut) { NewTab(); NewTab(); ASSERT_TRUE(active_browser()->WaitForTabCountToBecome(3)); - PlatformThread::Sleep(sleep_timeout_ms()); + base::PlatformThread::Sleep(sleep_timeout_ms()); ASSERT_TRUE(DragTabOut()); int window_count; ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); @@ -24,7 +25,7 @@ TEST_F(AutomatedUITestBase, DragLeftRight) { ASSERT_TRUE(active_browser()->WaitForTabCountToBecome(3)); // TODO(phajdan.jr): We need a WaitForTabstripAnimationsToEnd() function. // Every sleep in this file should be replaced with it. - PlatformThread::Sleep(sleep_timeout_ms()); + base::PlatformThread::Sleep(sleep_timeout_ms()); scoped_refptr<TabProxy> dragged_tab(active_browser()->GetActiveTab()); int tab_index; @@ -34,13 +35,13 @@ TEST_F(AutomatedUITestBase, DragLeftRight) { // Drag the active tab to left. Now it should be the middle tab. ASSERT_TRUE(DragActiveTab(false)); // We wait for the animation to be over. - PlatformThread::Sleep(sleep_timeout_ms()); + base::PlatformThread::Sleep(sleep_timeout_ms()); ASSERT_TRUE(dragged_tab->GetTabIndex(&tab_index)); EXPECT_EQ(1, tab_index); // Drag the active tab to left. Now it should be the leftmost tab. ASSERT_TRUE(DragActiveTab(false)); - PlatformThread::Sleep(sleep_timeout_ms()); + base::PlatformThread::Sleep(sleep_timeout_ms()); ASSERT_TRUE(dragged_tab->GetTabIndex(&tab_index)); EXPECT_EQ(0, tab_index); @@ -50,13 +51,13 @@ TEST_F(AutomatedUITestBase, DragLeftRight) { // Drag the active tab to right. Now it should be the middle tab. ASSERT_TRUE(DragActiveTab(true)); - PlatformThread::Sleep(sleep_timeout_ms()); + base::PlatformThread::Sleep(sleep_timeout_ms()); ASSERT_TRUE(dragged_tab->GetTabIndex(&tab_index)); EXPECT_EQ(1, tab_index); // Drag the active tab to right. Now it should be the rightmost tab. ASSERT_TRUE(DragActiveTab(true)); - PlatformThread::Sleep(sleep_timeout_ms()); + base::PlatformThread::Sleep(sleep_timeout_ms()); ASSERT_TRUE(dragged_tab->GetTabIndex(&tab_index)); EXPECT_EQ(2, tab_index); diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.cc b/chrome/test/automated_ui_tests/automated_ui_tests.cc index 0b5d15b..e4293ce 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.cc +++ b/chrome/test/automated_ui_tests/automated_ui_tests.cc @@ -16,6 +16,7 @@ #include "base/string_number_conversions.h" #include "base/string_split.h" #include "base/string_util.h" +#include "base/threading/platform_thread.h" #include "base/time.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/browser_process.h" @@ -383,7 +384,7 @@ bool AutomatedUITest::DoAction(const std::string& action) { did_complete_action = true; } else if (LowerCaseEqualsASCII(action, "sleep")) { // This is for debugging, it probably shouldn't be used real tests. - PlatformThread::Sleep(kDebuggingTimeoutMsec); + base::PlatformThread::Sleep(kDebuggingTimeoutMsec); did_complete_action = true; } else if (LowerCaseEqualsASCII(action, "star")) { did_complete_action = StarPage(); @@ -428,7 +429,7 @@ bool AutomatedUITest::DoAction(const std::string& action) { xml_writer_.EndElement(); if (post_action_delay_) - PlatformThread::Sleep(1000 * post_action_delay_); + base::PlatformThread::Sleep(1000 * post_action_delay_); return did_complete_action; } diff --git a/chrome/test/automation/autocomplete_edit_proxy.cc b/chrome/test/automation/autocomplete_edit_proxy.cc index 019326b..fd8061b 100644 --- a/chrome/test/automation/autocomplete_edit_proxy.cc +++ b/chrome/test/automation/autocomplete_edit_proxy.cc @@ -6,6 +6,7 @@ #include <vector> +#include "base/threading/platform_thread.h" #include "chrome/common/automation_constants.h" #include "chrome/common/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" @@ -66,7 +67,7 @@ bool AutocompleteEditProxy::WaitForQuery(int wait_timeout_ms) const { while (TimeTicks::Now() - start < timeout) { if (IsQueryInProgress(&query_in_progress) && !query_in_progress) return true; - PlatformThread::Sleep(automation::kSleepTime); + base::PlatformThread::Sleep(automation::kSleepTime); } // If we get here the query is still in progress. return false; diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index cf9391d..1138cc4 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -10,7 +10,7 @@ #include "base/basictypes.h" #include "base/logging.h" -#include "base/platform_thread.h" +#include "base/threading/platform_thread.h" #include "base/process_util.h" #include "base/ref_counted.h" #include "base/waitable_event.h" @@ -105,7 +105,7 @@ AutomationProxy::AutomationProxy(int command_execution_timeout_ms, // Zero also seems unreasonable, since we need to wait for IPC, but at // least it is legal... ;-) DCHECK_GE(command_execution_timeout_ms, 0); - listener_thread_id_ = PlatformThread::CurrentId(); + listener_thread_id_ = base::PlatformThread::CurrentId(); InitializeHandleTracker(); InitializeThread(); } diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h index ee77016..60677f7 100644 --- a/chrome/test/automation/automation_proxy.h +++ b/chrome/test/automation/automation_proxy.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_TEST_AUTOMATION_AUTOMATION_PROXY_H__ -#define CHROME_TEST_AUTOMATION_AUTOMATION_PROXY_H__ +#ifndef CHROME_TEST_AUTOMATION_AUTOMATION_PROXY_H_ +#define CHROME_TEST_AUTOMATION_AUTOMATION_PROXY_H_ #pragma once #include <string> @@ -12,6 +12,7 @@ #include "app/message_box_flags.h" #include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/threading/platform_thread.h" #include "base/process_util.h" #include "base/scoped_ptr.h" #include "base/time.h" @@ -301,9 +302,9 @@ class AutomationProxy : public IPC::Channel::Listener, // Delay to let the browser execute the command. base::TimeDelta command_execution_timeout_; - PlatformThreadId listener_thread_id_; + base::PlatformThreadId listener_thread_id_; DISALLOW_COPY_AND_ASSIGN(AutomationProxy); }; -#endif // CHROME_TEST_AUTOMATION_AUTOMATION_PROXY_H__ +#endif // CHROME_TEST_AUTOMATION_AUTOMATION_PROXY_H_ diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc index 8568e5e..465b610 100644 --- a/chrome/test/automation/automation_proxy_uitest.cc +++ b/chrome/test/automation/automation_proxy_uitest.cc @@ -1556,7 +1556,7 @@ TEST_F(AutomationProxyTest5, TestLifetimeOfDomAutomationController) { tab->NavigateToURL(net::FilePathToFileURL(filename))); // Allow some time for the popup to show up and close. - PlatformThread::Sleep(sleep_timeout_ms()); + base::PlatformThread::Sleep(sleep_timeout_ms()); std::wstring expected(L"string"); std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc index ae18470..9ba3057 100644 --- a/chrome/test/automation/browser_proxy.cc +++ b/chrome/test/automation/browser_proxy.cc @@ -8,7 +8,7 @@ #include "base/json/json_reader.h" #include "base/logging.h" -#include "base/platform_thread.h" +#include "base/threading/platform_thread.h" #include "base/time.h" #include "chrome/common/automation_constants.h" #include "chrome/common/automation_messages.h" @@ -206,7 +206,7 @@ bool BrowserProxy::WaitForTabToBecomeActive(int tab, const TimeTicks start = TimeTicks::Now(); const TimeDelta timeout = TimeDelta::FromMilliseconds(wait_timeout); while (TimeTicks::Now() - start < timeout) { - PlatformThread::Sleep(automation::kSleepTime); + base::PlatformThread::Sleep(automation::kSleepTime); int active_tab; if (GetActiveTabIndex(&active_tab) && active_tab == tab) return true; diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc index 2325958..1d1583c 100644 --- a/chrome/test/automation/proxy_launcher.cc +++ b/chrome/test/automation/proxy_launcher.cc @@ -4,6 +4,7 @@ #include "chrome/test/automation/proxy_launcher.h" +#include "base/threading/platform_thread.h" #include "chrome/common/automation_constants.h" #include "chrome/common/logging_chrome.h" #include "chrome/test/automation/automation_proxy.h" @@ -37,7 +38,7 @@ void NamedProxyLauncher::InitializeConnection(UITestBase* ui_test_base) const { // Wait for browser to be ready for connections. struct stat file_info; while (stat(kInterfacePath, &file_info)) - PlatformThread::Sleep(automation::kSleepTime); + base::PlatformThread::Sleep(automation::kSleepTime); } ui_test_base->ConnectToRunningBrowser(); diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index ce7ed16..bb8d9cc 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -8,6 +8,7 @@ #include "base/logging.h" #include "base/string16.h" +#include "base/threading/platform_thread.h" #include "base/utf_string_conversions.h" #include "chrome/common/automation_messages.h" #include "chrome/common/json_value_serializer.h" @@ -363,7 +364,7 @@ bool TabProxy::WaitForChildWindowCountToChange(int count, int* new_count, int wait_timeout) { int intervals = std::max(wait_timeout / automation::kSleepTime, 1); for (int i = 0; i < intervals; ++i) { - PlatformThread::Sleep(automation::kSleepTime); + base::PlatformThread::Sleep(automation::kSleepTime); bool succeeded = GetConstrainedWindowCount(new_count); if (!succeeded) return false; @@ -391,7 +392,7 @@ bool TabProxy::WaitForBlockedPopupCountToChangeTo(int target_count, int wait_timeout) { int intervals = std::max(wait_timeout / automation::kSleepTime, 1); for (int i = 0; i < intervals; ++i) { - PlatformThread::Sleep(automation::kSleepTime); + base::PlatformThread::Sleep(automation::kSleepTime); int new_count = -1; bool succeeded = GetBlockedPopupCount(&new_count); if (!succeeded) diff --git a/chrome/test/live_sync/live_sync_test.cc b/chrome/test/live_sync/live_sync_test.cc index 9c287d2..9a3d125 100644 --- a/chrome/test/live_sync/live_sync_test.cc +++ b/chrome/test/live_sync/live_sync_test.cc @@ -11,10 +11,10 @@ #include "base/logging.h" #include "base/message_loop.h" #include "base/path_service.h" -#include "base/platform_thread.h" #include "base/string_util.h" #include "base/task.h" #include "base/test/test_timeouts.h" +#include "base/threading/platform_thread.h" #include "base/values.h" #include "base/waitable_event.h" #include "chrome/browser/browser_thread.h" @@ -398,7 +398,7 @@ bool LiveSyncTest::WaitForTestServerToStart(int time_ms, int intervals) { for (int i = 0; i < intervals; ++i) { if (IsTestServerRunning()) return true; - PlatformThread::Sleep(time_ms / intervals); + base::PlatformThread::Sleep(time_ms / intervals); } return false; } diff --git a/chrome/test/memory_test/memory_test.cc b/chrome/test/memory_test/memory_test.cc index 7b4d78f..29e7d27 100644 --- a/chrome/test/memory_test/memory_test.cc +++ b/chrome/test/memory_test/memory_test.cc @@ -9,6 +9,7 @@ #include "base/path_service.h" #include "base/process_util.h" #include "base/string_util.h" +#include "base/threading/platform_thread.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" @@ -148,7 +149,7 @@ class MemoryTest : public UIPerfTest { SCOPED_TRACE(url); if (url == "<PAUSE>") { // Special command to delay on this page - PlatformThread::Sleep(2000); + base::PlatformThread::Sleep(2000); continue; } @@ -197,7 +198,7 @@ class MemoryTest : public UIPerfTest { // A new window will not load a url if requested too soon. The window // stays on the new tab page instead. - PlatformThread::Sleep(200); + base::PlatformThread::Sleep(200); active_window = window_count - 1; window = automation()->GetBrowserWindow(active_window); @@ -224,7 +225,7 @@ class MemoryTest : public UIPerfTest { // TODO(mbelshe): Bug 2953 // The automation crashes periodically if we cycle too quickly. // To make these tests more reliable, slowing them down a bit. - PlatformThread::Sleep(100); + base::PlatformThread::Sleep(100); } size_t stop_size = base::GetSystemCommitCharge(); diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc index 5e7aae1..20edf54 100644 --- a/chrome/test/mini_installer_test/chrome_mini_installer.cc +++ b/chrome/test/mini_installer_test/chrome_mini_installer.cc @@ -7,11 +7,11 @@ #include "base/command_line.h" #include "base/file_util.h" #include "base/path_service.h" -#include "base/platform_thread.h" #include "base/process.h" #include "base/process_util.h" #include "base/string_number_conversions.h" #include "base/string_util.h" +#include "base/threading/platform_thread.h" #include "base/win/registry.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/google_update_constants.h" @@ -307,7 +307,7 @@ bool ChromeMiniInstaller::CloseUninstallWindow() { window_name = mini_installer_constants::kChromeUninstallDialogName; while (hndl == NULL && timer < 5000) { hndl = FindWindow(NULL, window_name.c_str()); - PlatformThread::Sleep(200); + base::PlatformThread::Sleep(200); timer = timer + 200; } @@ -338,7 +338,7 @@ bool ChromeMiniInstaller::CloseChromeBrowser() { while (!handle && timer < 10000) { handle = FindWindowEx(NULL, handle, L"Chrome_WidgetWin_0", NULL); if (!handle) { - PlatformThread::Sleep(100); + base::PlatformThread::Sleep(100); timer = timer + 100; } } @@ -348,7 +348,7 @@ bool ChromeMiniInstaller::CloseChromeBrowser() { LRESULT _result = SendMessage(handle, WM_CLOSE, 1, 0); if (_result != 0) return false; - PlatformThread::Sleep(1000); + base::PlatformThread::Sleep(1000); timer = timer + 1000; } if (base::GetProcessCount(installer::kChromeExe, NULL) > 0) { @@ -382,7 +382,7 @@ bool ChromeMiniInstaller::CheckRegistryKeyOnUninstall( int timer = 0; while ((key.Open(GetRootRegistryKey(), key_path.c_str(), KEY_ALL_ACCESS)) && (timer < 20000)) { - PlatformThread::Sleep(200); + base::PlatformThread::Sleep(200); timer = timer + 200; } return CheckRegistryKey(key_path); @@ -601,7 +601,7 @@ void ChromeMiniInstaller::VerifyInstall(bool over_install) { MiniInstallerTestUtil::VerifyProcessLaunch( installer::kChromeExe, true); } - PlatformThread::Sleep(800); + base::PlatformThread::Sleep(800); FindChromeShortcut(); LaunchAndCloseChrome(over_install); } @@ -645,7 +645,7 @@ void ChromeMiniInstaller::LaunchBrowser(const std::wstring& launch_path, bool expected_status) { base::LaunchApp(L"\"" + launch_path + L"\"" + L" " + launch_args, false, false, NULL); - PlatformThread::Sleep(1000); + base::PlatformThread::Sleep(1000); MiniInstallerTestUtil::VerifyProcessLaunch(process_name.c_str(), expected_status); } diff --git a/chrome/test/mini_installer_test/mini_installer_test_util.cc b/chrome/test/mini_installer_test/mini_installer_test_util.cc index a07ada5..7c0dddd 100644 --- a/chrome/test/mini_installer_test/mini_installer_test_util.cc +++ b/chrome/test/mini_installer_test/mini_installer_test_util.cc @@ -6,10 +6,10 @@ #include "base/file_util.h" #include "base/path_service.h" -#include "base/platform_thread.h" #include "base/process_util.h" #include "base/string_util.h" #include "base/test/test_timeouts.h" +#include "base/threading/platform_thread.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/installer/util/logging_installer.h" @@ -36,7 +36,7 @@ void MiniInstallerTestUtil::CloseProcesses( while ((base::GetProcessCount(executable_name, NULL) > 0) && (timer < 20000)) { base::KillProcesses(executable_name, 1, NULL); - PlatformThread::Sleep(200); + base::PlatformThread::Sleep(200); timer = timer + 200; } ASSERT_EQ(0, base::GetProcessCount(executable_name, NULL)); @@ -49,7 +49,7 @@ bool MiniInstallerTestUtil::CloseWindow(const wchar_t* window_name, HWND hndl = FindWindow(NULL, window_name); while (hndl == NULL && (timer < 60000)) { hndl = FindWindow(NULL, window_name); - PlatformThread::Sleep(200); + base::PlatformThread::Sleep(200); timer = timer + 200; } if (hndl != NULL) { @@ -274,7 +274,7 @@ void MiniInstallerTestUtil::VerifyProcessLaunch( while ((base::GetProcessCount(process_name, NULL) == 0) && (timer < wait_time)) { - PlatformThread::Sleep(200); + base::PlatformThread::Sleep(200); timer = timer + 200; } @@ -291,7 +291,7 @@ bool MiniInstallerTestUtil::VerifyProcessClose( VLOG(1) << "Waiting for this process to end: " << process_name; while ((base::GetProcessCount(process_name, NULL) > 0) && (timer < TestTimeouts::large_test_timeout_ms())) { - PlatformThread::Sleep(200); + base::PlatformThread::Sleep(200); timer = timer + 200; } } else { diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index ffa6190..2aeb0a7a 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -46,6 +46,7 @@ #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/test/test_file_util.h" +#include "base/threading/platform_thread.h" #include "base/time.h" #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/prefs/pref_service.h" @@ -214,9 +215,9 @@ class PageLoadTest : public UITest { // This used to be settable but the flag went away. int sleep_time_ms = 2000; window->SimulateOSKeyPress(app::VKEY_NEXT, 0); - PlatformThread::Sleep(sleep_time_ms); + base::PlatformThread::Sleep(sleep_time_ms); window->SimulateOSKeyPress(app::VKEY_NEXT, 0); - PlatformThread::Sleep(sleep_time_ms); + base::PlatformThread::Sleep(sleep_time_ms); } } } diff --git a/chrome/test/tab_switching/tab_switching_test.cc b/chrome/test/tab_switching/tab_switching_test.cc index 29776fd..68b97fa 100644 --- a/chrome/test/tab_switching/tab_switching_test.cc +++ b/chrome/test/tab_switching/tab_switching_test.cc @@ -7,8 +7,8 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/path_service.h" -#include "base/platform_thread.h" #include "base/scoped_ptr.h" +#include "base/threading/platform_thread.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" @@ -112,7 +112,7 @@ class TabSwitchingUITest : public UIPerfTest { log_has_been_dumped = file_util::ReadFileToString(log_file_name_, &contents); if (!log_has_been_dumped) - PlatformThread::Sleep(100); + base::PlatformThread::Sleep(100); } while (!log_has_been_dumped && max_tries--); ASSERT_TRUE(log_has_been_dumped) << "Failed to read the log file"; diff --git a/chrome/test/ui/run_all_unittests.cc b/chrome/test/ui/run_all_unittests.cc index 7745bcaf..42aefa0 100644 --- a/chrome/test/ui/run_all_unittests.cc +++ b/chrome/test/ui/run_all_unittests.cc @@ -1,11 +1,11 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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/platform_thread.h" +#include "base/threading/platform_thread.h" #include "chrome/test/ui/ui_test_suite.h" int main(int argc, char **argv) { - PlatformThread::SetName("Tests_Main"); + base::PlatformThread::SetName("Tests_Main"); return UITestSuite(argc, argv).Run(); } diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 1d50fe5..9ef3ae6 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -21,13 +21,13 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/path_service.h" -#include "base/platform_thread.h" #include "base/process_util.h" #include "base/scoped_ptr.h" #include "base/scoped_temp_dir.h" #include "base/string_number_conversions.h" #include "base/string_split.h" #include "base/test/test_file_util.h" +#include "base/threading/platform_thread.h" #include "base/time.h" #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" @@ -212,7 +212,7 @@ void UITestBase::WaitForBrowserLaunch() { if (wait_for_initial_loads_) ASSERT_TRUE(automation_proxy_->WaitForInitialLoads()); else - PlatformThread::Sleep(sleep_timeout_ms()); + base::PlatformThread::Sleep(sleep_timeout_ms()); EXPECT_TRUE(automation()->SetFilteredInet(ShouldFilterInet())); } @@ -1021,7 +1021,7 @@ bool UITest::EvictFileFromSystemCacheWrapper(const FilePath& path) { for (int i = 0; i < 10; i++) { if (file_util::EvictFileFromSystemCache(path)) return true; - PlatformThread::Sleep(sleep_timeout_ms() / 10); + base::PlatformThread::Sleep(sleep_timeout_ms() / 10); } return false; } @@ -1046,7 +1046,7 @@ void UITest::WaitForGeneratedFileAndCheck( file_util::GetFileInfo(generated_file, &previous); exist = true; } - PlatformThread::Sleep(sleep_timeout_ms() / kCycles); + base::PlatformThread::Sleep(sleep_timeout_ms() / kCycles); } EXPECT_TRUE(exist); diff --git a/chrome/test/webdriver/commands/find_element_commands.cc b/chrome/test/webdriver/commands/find_element_commands.cc index acda1393..d208a00 100644 --- a/chrome/test/webdriver/commands/find_element_commands.cc +++ b/chrome/test/webdriver/commands/find_element_commands.cc @@ -8,6 +8,7 @@ #include <string> #include "base/string_number_conversions.h" +#include "base/threading/platform_thread.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "third_party/webdriver/atoms.h" @@ -100,7 +101,7 @@ void FindElementCommand::ExecutePost(Response* const response) { int64 elapsed_time = (base::Time::Now() - start_time).InMilliseconds(); done = done || elapsed_time > session_->implicit_wait(); - PlatformThread::Sleep(50); // Prevent a busy loop that eats the cpu. + base::PlatformThread::Sleep(50); // Prevent a busy loop that eats the cpu. } response->set_value(result); diff --git a/chrome/test/webdriver/server.cc b/chrome/test/webdriver/server.cc index 4760928..6409524 100644 --- a/chrome/test/webdriver/server.cc +++ b/chrome/test/webdriver/server.cc @@ -19,6 +19,7 @@ #include "base/logging.h" #include "base/scoped_ptr.h" #include "base/string_util.h" +#include "base/threading/platform_thread.h" #include "base/utf_string_conversions.h" #include "chrome/test/webdriver/dispatch.h" @@ -129,7 +130,7 @@ int main(int argc, char *argv[]) { std::cout << "Starting server on port: " << port << std::endl; // The default behavior is to run this service forever. while (true) - PlatformThread::Sleep(3600); + base::PlatformThread::Sleep(3600); // We should not reach here since the service should never quit. // TODO(jmikhail): register a listener for SIGTERM and break the |