| 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.
|
|
|