| OLD | NEW |
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
| 61 // This is not really Windows-specific, the transition is just being done | 61 // This is not really Windows-specific, the transition is just being done |
| 62 // in stages, and Windows is first. See below for more info. | 62 // in stages, and Windows is first. See below for more info. |
| 63 // TODO(phajdan.jr): Remove #ifdef after fixing http://crbug.com/61062. | 63 // TODO(phajdan.jr): Remove #ifdef after fixing http://crbug.com/61062. |
| 64 private: | 64 private: |
| 65 NotificationService notification_service_; | 65 NotificationService notification_service_; |
| 66 #endif | 66 #endif |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 TEST_F(MetricsServiceTest, CloseRenderersNormally) { | 69 #if defined(OS_MACOSX) |
| 70 // Flaky across all Mac bots: http://crbug.com/92635 |
| 71 #define MAYBE_CloseRenderersNormally FLAKY_CloseRenderersNormally |
| 72 #else |
| 73 #define MAYBE_CloseRenderersNormally CloseRenderersNormally |
| 74 #endif |
| 75 |
| 76 TEST_F(MetricsServiceTest, MAYBE_CloseRenderersNormally) { |
| 70 OpenTabs(); | 77 OpenTabs(); |
| 71 QuitBrowser(); | 78 QuitBrowser(); |
| 72 | 79 |
| 73 scoped_ptr<PrefService> local_state(GetLocalState()); | 80 scoped_ptr<PrefService> local_state(GetLocalState()); |
| 74 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); | 81 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); |
| 75 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); | 82 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); |
| 76 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); | 83 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); |
| 77 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); | 84 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); |
| 78 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); | 85 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); |
| 79 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); | 86 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); | 133 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); |
| 127 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); | 134 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); |
| 128 #if defined(TOUCH_UI) | 135 #if defined(TOUCH_UI) |
| 129 // The keyboard page loads for touchui. | 136 // The keyboard page loads for touchui. |
| 130 EXPECT_EQ(5, local_state->GetInteger(prefs::kStabilityPageLoadCount)); | 137 EXPECT_EQ(5, local_state->GetInteger(prefs::kStabilityPageLoadCount)); |
| 131 #else | 138 #else |
| 132 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); | 139 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); |
| 133 #endif | 140 #endif |
| 134 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); | 141 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); |
| 135 } | 142 } |
| OLD | NEW |