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" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/platform_thread.h" | 13 #include "base/platform_thread.h" |
14 #include "chrome/browser/browser_thread.h" | |
15 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
16 #include "chrome/browser/prefs/pref_service_mock_builder.h" | 15 #include "chrome/browser/prefs/pref_service_mock_builder.h" |
17 #include "chrome/browser/prefs/pref_value_store.h" | 16 #include "chrome/browser/prefs/pref_value_store.h" |
18 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
19 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
20 #include "chrome/common/json_pref_store.h" | 19 #include "chrome/common/json_pref_store.h" |
21 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
22 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
23 #include "chrome/test/automation/browser_proxy.h" | 22 #include "chrome/test/automation/browser_proxy.h" |
24 #include "chrome/test/automation/tab_proxy.h" | 23 #include "chrome/test/automation/tab_proxy.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 scoped_ptr<PrefService> local_state(GetLocalState()); | 106 scoped_ptr<PrefService> local_state(GetLocalState()); |
108 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); | 107 local_state->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); |
109 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); | 108 local_state->RegisterIntegerPref(prefs::kStabilityLaunchCount, 0); |
110 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); | 109 local_state->RegisterIntegerPref(prefs::kStabilityPageLoadCount, 0); |
111 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); | 110 local_state->RegisterIntegerPref(prefs::kStabilityRendererCrashCount, 0); |
112 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); | 111 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); |
113 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); | 112 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); |
114 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); | 113 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); |
115 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); | 114 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); |
116 } | 115 } |
OLD | NEW |