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" |
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/test/test_timeouts.h" | 13 #include "base/test/test_timeouts.h" |
14 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
15 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
16 #include "chrome/browser/prefs/pref_service_mock_builder.h" | 16 #include "chrome/browser/prefs/pref_service_mock_builder.h" |
17 #include "chrome/browser/prefs/pref_value_store.h" | 17 #include "chrome/browser/prefs/pref_value_store.h" |
18 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
20 #include "chrome/common/json_pref_store.h" | 20 #include "chrome/common/json_pref_store.h" |
21 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
22 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
23 #include "chrome/test/automation/automation_proxy.h" | 23 #include "chrome/test/automation/automation_proxy.h" |
24 #include "chrome/test/automation/browser_proxy.h" | 24 #include "chrome/test/automation/browser_proxy.h" |
25 #include "chrome/test/automation/tab_proxy.h" | 25 #include "chrome/test/automation/tab_proxy.h" |
26 #include "chrome/test/ui/ui_test.h" | 26 #include "chrome/test/ui/ui_test.h" |
27 #include "content/common/notification_service.h" | |
28 #include "net/base/net_util.h" | 27 #include "net/base/net_util.h" |
29 | 28 |
30 class MetricsServiceTest : public UITest { | 29 class MetricsServiceTest : public UITest { |
31 public: | 30 public: |
32 MetricsServiceTest() : UITest() { | 31 MetricsServiceTest() : UITest() { |
33 // We need to show the window so web content type tabs load. | 32 // We need to show the window so web content type tabs load. |
34 show_window_ = true; | 33 show_window_ = true; |
35 } | 34 } |
36 | 35 |
37 // Open a few tabs of random content | 36 // Open a few tabs of random content |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); | 114 EXPECT_TRUE(local_state->GetBoolean(prefs::kStabilityExitedCleanly)); |
116 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); | 115 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityLaunchCount)); |
117 #if defined(TOUCH_UI) | 116 #if defined(TOUCH_UI) |
118 // The keyboard page loads for touchui. | 117 // The keyboard page loads for touchui. |
119 EXPECT_EQ(5, local_state->GetInteger(prefs::kStabilityPageLoadCount)); | 118 EXPECT_EQ(5, local_state->GetInteger(prefs::kStabilityPageLoadCount)); |
120 #else | 119 #else |
121 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); | 120 EXPECT_EQ(4, local_state->GetInteger(prefs::kStabilityPageLoadCount)); |
122 #endif | 121 #endif |
123 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); | 122 EXPECT_EQ(1, local_state->GetInteger(prefs::kStabilityRendererCrashCount)); |
124 } | 123 } |
OLD | NEW |