Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4718)

Unified Diff: chrome/browser/browser_uitest.cc

Issue 63113: Convert Windows Sleep to PlatformThread::Sleep... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/crash_recovery_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_uitest.cc
===================================================================
--- chrome/browser/browser_uitest.cc (revision 13127)
+++ chrome/browser/browser_uitest.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 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.
@@ -65,8 +65,10 @@
file_util::AppendToPath(&test_file, L"title1.html");
NavigateToURL(net::FilePathToFileURL(test_file));
- Sleep(sleep_timeout_ms()); // The browser lazily updates the title.
+ // The browser lazily updates the title.
+ PlatformThread::Sleep(sleep_timeout_ms());
+
EXPECT_EQ(WindowCaptionFromPageTitle(L"title1.html"), GetWindowTitle());
EXPECT_EQ(L"title1.html", GetActiveTabTitle());
}
@@ -78,8 +80,10 @@
file_util::AppendToPath(&test_file, L"title2.html");
NavigateToURL(net::FilePathToFileURL(test_file));
- Sleep(sleep_timeout_ms()); // The browser lazily updates the title.
+ // The browser lazily updates the title.
+ PlatformThread::Sleep(sleep_timeout_ms());
+
const std::wstring test_title(L"Title Of Awesomeness");
EXPECT_EQ(WindowCaptionFromPageTitle(test_title), GetWindowTitle());
EXPECT_EQ(test_title, GetActiveTabTitle());
@@ -120,14 +124,14 @@
file_util::AppendToPath(&test_file, L"title1.html");
NavigateToURL(net::FilePathToFileURL(test_file));
- Sleep(action_timeout_ms());
+ PlatformThread::Sleep(action_timeout_ms());
// Simulate an end of session. Normally this happens when the user
// shuts down the pc or logs off.
HWND window_handle = GetMainWindow();
ASSERT_TRUE(::PostMessageW(window_handle, WM_ENDSESSION, 0, 0));
- Sleep(action_timeout_ms());
+ PlatformThread::Sleep(action_timeout_ms());
ASSERT_FALSE(IsBrowserRunning());
// Make sure the UMA metrics say we didn't crash.
@@ -207,7 +211,7 @@
// Make sure that a new tab has been created and that we have a new renderer
// process for it.
tab->NavigateToURLAsync(fork_url);
- Sleep(action_timeout_ms());
+ PlatformThread::Sleep(action_timeout_ms());
ASSERT_EQ(orig_process_count + 1, GetBrowserProcessCount());
int new_tab_count = -1;
ASSERT_TRUE(window->GetTabCount(&new_tab_count));
@@ -246,7 +250,7 @@
// Make sure that a new tab but not new process has been created.
tab->NavigateToURLAsync(dont_fork_url);
- Sleep(action_timeout_ms());
+ PlatformThread::Sleep(action_timeout_ms());
ASSERT_EQ(orig_process_count, GetBrowserProcessCount());
int new_tab_count = -1;
ASSERT_TRUE(window->GetTabCount(&new_tab_count));
@@ -258,7 +262,7 @@
// Make sure that no new process has been created.
tab->NavigateToURLAsync(dont_fork_url2);
- Sleep(action_timeout_ms());
+ PlatformThread::Sleep(action_timeout_ms());
ASSERT_EQ(orig_process_count, GetBrowserProcessCount());
}
@@ -270,7 +274,7 @@
int i;
for (i = 0; i < 10; ++i) {
- Sleep(action_max_timeout_ms() / 10);
+ PlatformThread::Sleep(action_max_timeout_ms() / 10);
std::wstring title = GetActiveTabTitle();
if (title == L"PASSED") {
// Success, bail out.
« no previous file with comments | « no previous file | chrome/browser/crash_recovery_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698