OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "ash/metrics/user_metrics_recorder.h" | 5 #include "ash/metrics/user_metrics_recorder.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "ash/common/login_status.h" | 9 #include "ash/common/login_status.h" |
10 #include "ash/common/shelf/shelf_model.h" | 10 #include "ash/common/shelf/shelf_model.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 // Histogram value verifier. | 69 // Histogram value verifier. |
70 base::HistogramTester histograms_; | 70 base::HistogramTester histograms_; |
71 | 71 |
72 // The active SystemTrayDelegate. Not owned. | 72 // The active SystemTrayDelegate. Not owned. |
73 test::TestSystemTrayDelegate* test_system_tray_delegate_; | 73 test::TestSystemTrayDelegate* test_system_tray_delegate_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(UserMetricsRecorderTest); | 75 DISALLOW_COPY_AND_ASSIGN(UserMetricsRecorderTest); |
76 }; | 76 }; |
77 | 77 |
78 UserMetricsRecorderTest::UserMetricsRecorderTest() { | 78 UserMetricsRecorderTest::UserMetricsRecorderTest() {} |
79 } | |
80 | 79 |
81 UserMetricsRecorderTest::~UserMetricsRecorderTest() { | 80 UserMetricsRecorderTest::~UserMetricsRecorderTest() {} |
82 } | |
83 | 81 |
84 void UserMetricsRecorderTest::SetUp() { | 82 void UserMetricsRecorderTest::SetUp() { |
85 test::AshTestBase::SetUp(); | 83 test::AshTestBase::SetUp(); |
86 user_metrics_recorder_test_api_.reset(new test::UserMetricsRecorderTestAPI()); | 84 user_metrics_recorder_test_api_.reset(new test::UserMetricsRecorderTestAPI()); |
87 test_system_tray_delegate_ = GetSystemTrayDelegate(); | 85 test_system_tray_delegate_ = GetSystemTrayDelegate(); |
88 } | 86 } |
89 | 87 |
90 void UserMetricsRecorderTest::TearDown() { | 88 void UserMetricsRecorderTest::TearDown() { |
91 test_system_tray_delegate_ = nullptr; | 89 test_system_tray_delegate_ = nullptr; |
92 test::AshTestBase::TearDown(); | 90 test::AshTestBase::TearDown(); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 aura::Window* unpinned_window_5 = CreateTestWindow(); | 213 aura::Window* unpinned_window_5 = CreateTestWindow(); |
216 test_shelf_delegate->AddShelfItem(unpinned_window_5); | 214 test_shelf_delegate->AddShelfItem(unpinned_window_5); |
217 | 215 |
218 user_metrics_recorder_test_api()->RecordPeriodicMetrics(); | 216 user_metrics_recorder_test_api()->RecordPeriodicMetrics(); |
219 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfItems, 5, 1); | 217 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfItems, 5, 1); |
220 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfPinnedItems, 2, 1); | 218 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfPinnedItems, 2, 1); |
221 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfUnpinnedItems, 3, 1); | 219 histograms().ExpectBucketCount(kAsh_Shelf_NumberOfUnpinnedItems, 3, 1); |
222 } | 220 } |
223 | 221 |
224 } // namespace ash | 222 } // namespace ash |
OLD | NEW |