| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); | 66 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); |
| 67 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); | 67 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); |
| 68 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); | 68 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); |
| 69 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); | 69 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); |
| 70 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); | 70 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); |
| 71 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); | 71 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); |
| 72 EXPECT_EQ(3, local_state->GetInteger(prefs::kStabilityPageLoadCount)); | 72 EXPECT_EQ(3, local_state->GetInteger(prefs::kStabilityPageLoadCount)); |
| 73 EXPECT_EQ(0, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); | 73 EXPECT_EQ(0, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 #if defined(OS_WIN) | |
| 77 // http://crbug.com/32048 | |
| 78 #define CrashRenderers FLAKY_CrashRenders | |
| 79 #endif | |
| 80 TEST_F(MetricsServiceTest, CrashRenderers) { | 76 TEST_F(MetricsServiceTest, CrashRenderers) { |
| 81 // This doesn't make sense to test in single process mode. | 77 // This doesn't make sense to test in single process mode. |
| 82 if (in_process_renderer_) | 78 if (in_process_renderer_) |
| 83 return; | 79 return; |
| 84 | 80 |
| 85 OpenTabs(); | 81 OpenTabs(); |
| 86 | 82 |
| 87 { | 83 { |
| 88 // Limit the lifetime of various automation proxies used here. We must | 84 // Limit the lifetime of various automation proxies used here. We must |
| 89 // destroy them before calling QuitBrowser. | 85 // destroy them before calling QuitBrowser. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 112 scoped_ptr<PrefService> local_state(GetLocalState()); | 108 scoped_ptr<PrefService> local_state(GetLocalState()); |
| 113 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); | 109 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); |
| 114 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); | 110 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); |
| 115 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); | 111 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); |
| 116 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); | 112 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); |
| 117 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); | 113 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); |
| 118 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); | 114 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); |
| 119 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); | 115 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); |
| 120 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); | 116 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); |
| 121 } | 117 } |
| OLD | NEW |