OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 Loading... |
95 | 95 |
96 // We should get a crash dump on Windows. | 96 // We should get a crash dump on Windows. |
97 // Also on Linux with Breakpad enabled. | 97 // Also on Linux with Breakpad enabled. |
98 #if defined(OS_WIN) || defined(USE_LINUX_BREAKPAD) | 98 #if defined(OS_WIN) || defined(USE_LINUX_BREAKPAD) |
99 expected_crashes_ = 1; | 99 expected_crashes_ = 1; |
100 #endif | 100 #endif |
101 ASSERT_TRUE(tab->NavigateToURLAsync(GURL("about:crash"))); | 101 ASSERT_TRUE(tab->NavigateToURLAsync(GURL("about:crash"))); |
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 PlatformThread::Sleep(1000); | 105 PlatformThread::Sleep(sleep_timeout_ms()); |
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 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); | 116 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); |
117 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); | 117 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); |
118 } | 118 } |
OLD | NEW |