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

Side by Side Diff: chrome/browser/metrics/metrics_service_uitest.cc

Issue 9088015: Fix Sleep() calls to use TimeDelta in portions of chrome/browser. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/net/connect_interceptor_unittest.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Tests the MetricsService stat recording to make sure that the numbers are 5 // Tests the MetricsService stat recording to make sure that the numbers are
6 // what we expect. 6 // what we expect.
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // We can get crash dumps on Windows always, Linux when breakpad is 95 // We can get crash dumps on Windows always, Linux when breakpad is
96 // enabled, and all platforms for official Google Chrome builds. 96 // enabled, and all platforms for official Google Chrome builds.
97 #if defined(OS_WIN) || defined(USE_LINUX_BREAKPAD) || \ 97 #if defined(OS_WIN) || defined(USE_LINUX_BREAKPAD) || \
98 defined(GOOGLE_CHROME_BUILD) 98 defined(GOOGLE_CHROME_BUILD)
99 expected_crashes_ = 1; 99 expected_crashes_ = 1;
100 #endif 100 #endif
101 ASSERT_TRUE(tab->NavigateToURLAsync(GURL(chrome::kAboutCrashURL))); 101 ASSERT_TRUE(tab->NavigateToURLAsync(GURL(chrome::kAboutCrashURL)));
102 } 102 }
103 103
104 // Give the browser a chance to notice the crashed tab. 104 // Give the browser a chance to notice the crashed tab.
105 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms()); 105 base::PlatformThread::Sleep(TestTimeouts::action_timeout());
106 106
107 QuitBrowser(); 107 QuitBrowser();
108 108
109 scoped_ptr<PrefService> local_state(GetLocalState()); 109 scoped_ptr<PrefService> local_state(GetLocalState());
110 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); 110 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true);
111 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); 111 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0);
112 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); 112 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0);
113 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); 113 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0);
114 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); 114 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly));
115 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); 115 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount));
116 #if defined(USE_VIRTUAL_KEYBOARD) 116 #if defined(USE_VIRTUAL_KEYBOARD)
117 // The keyboard page loads. 117 // The keyboard page loads.
118 EXPECT_EQ(5, local_state->GetInteger(prefs::kStabilityPageLoadCount)); 118 EXPECT_EQ(5, local_state->GetInteger(prefs::kStabilityPageLoadCount));
119 #else 119 #else
120 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); 120 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount));
121 #endif 121 #endif
122 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); 122 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount));
123 } 123 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/connect_interceptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698