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

Side by Side Diff: chrome/browser/crash_recovery_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser_uitest.cc ('k') | chrome/browser/download/save_page_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_util.h" 5 #include "base/file_util.h"
6 #include "chrome/test/automation/browser_proxy.h" 6 #include "chrome/test/automation/browser_proxy.h"
7 #include "chrome/test/automation/tab_proxy.h" 7 #include "chrome/test/automation/tab_proxy.h"
8 #include "chrome/test/ui/ui_test.h" 8 #include "chrome/test/ui/ui_test.h"
9 #include "net/base/net_util.h" 9 #include "net/base/net_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
(...skipping 13 matching lines...) Expand all
25 NavigateToURL(url); 25 NavigateToURL(url);
26 26
27 std::wstring title1 = GetActiveTabTitle(); 27 std::wstring title1 = GetActiveTabTitle();
28 28
29 scoped_ptr<TabProxy> tab(GetActiveTab()); 29 scoped_ptr<TabProxy> tab(GetActiveTab());
30 30
31 // Cause the renderer to crash. 31 // Cause the renderer to crash.
32 expected_crashes_ = 1; 32 expected_crashes_ = 1;
33 tab->NavigateToURLAsync(GURL("about:crash")); 33 tab->NavigateToURLAsync(GURL("about:crash"));
34 34
35 Sleep(1000); // Wait for the browser to notice the renderer crash. 35 // Wait for the browser to notice the renderer crash.
36 PlatformThread::Sleep(1000);
36 37
37 tab->Reload(); 38 tab->Reload();
38 39
39 std::wstring title2 = GetActiveTabTitle(); 40 std::wstring title2 = GetActiveTabTitle();
40 EXPECT_NE(title1, title2); 41 EXPECT_NE(title1, title2);
41 } 42 }
42 43
43 // Tests that loading a crashed page in a new tab correctly updates the title. 44 // Tests that loading a crashed page in a new tab correctly updates the title.
44 // There was an earlier bug (1270510) in process-per-site in which the max page 45 // There was an earlier bug (1270510) in process-per-site in which the max page
45 // ID of the RenderProcessHost was stale, so the NavigationEntry in the new tab 46 // ID of the RenderProcessHost was stale, so the NavigationEntry in the new tab
(...skipping 12 matching lines...) Expand all
58 59
59 const std::wstring title(L"Title Of Awesomeness"); 60 const std::wstring title(L"Title Of Awesomeness");
60 EXPECT_EQ(title, GetActiveTabTitle()); 61 EXPECT_EQ(title, GetActiveTabTitle());
61 62
62 scoped_ptr<TabProxy> tab(GetActiveTab()); 63 scoped_ptr<TabProxy> tab(GetActiveTab());
63 64
64 // Cause the renderer to crash. 65 // Cause the renderer to crash.
65 expected_crashes_ = 1; 66 expected_crashes_ = 1;
66 tab->NavigateToURLAsync(GURL("about:crash")); 67 tab->NavigateToURLAsync(GURL("about:crash"));
67 68
68 Sleep(1000); // Wait for the browser to notice the renderer crash. 69 // Wait for the browser to notice the renderer crash.
70 PlatformThread::Sleep(1000);
69 71
70 scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); 72 scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0));
71 ASSERT_TRUE(browser_proxy->AppendTab(url)); 73 ASSERT_TRUE(browser_proxy->AppendTab(url));
72 74
73 // Ensure the title of the new tab is updated, indicating that the navigation 75 // Ensure the title of the new tab is updated, indicating that the navigation
74 // entry was properly committed. 76 // entry was properly committed.
75 EXPECT_EQ(title, GetActiveTabTitle()); 77 EXPECT_EQ(title, GetActiveTabTitle());
76 } 78 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_uitest.cc ('k') | chrome/browser/download/save_page_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698