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 "ios/chrome/browser/metrics/mobile_session_shutdown_metrics_provider.h" | 5 #include "ios/chrome/browser/metrics/mobile_session_shutdown_metrics_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/prefs/testing_pref_service.h" | |
11 #include "base/test/histogram_tester.h" | 10 #include "base/test/histogram_tester.h" |
12 #include "components/metrics/metrics_pref_names.h" | 11 #include "components/metrics/metrics_pref_names.h" |
13 #include "components/metrics/metrics_service.h" | 12 #include "components/metrics/metrics_service.h" |
14 #include "components/metrics/metrics_state_manager.h" | 13 #include "components/metrics/metrics_state_manager.h" |
15 #include "components/metrics/test_metrics_service_client.h" | 14 #include "components/metrics/test_metrics_service_client.h" |
| 15 #include "components/prefs/testing_pref_service.h" |
16 #include "testing/gtest/include/gtest/gtest-param-test.h" | 16 #include "testing/gtest/include/gtest/gtest-param-test.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 bool IsMetricsReportingEnabled() { | 21 bool IsMetricsReportingEnabled() { |
22 return false; | 22 return false; |
23 } | 23 } |
24 | 24 |
25 } // namespace | 25 } // namespace |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // Now call the method under test and verify exactly one sample is written to | 173 // Now call the method under test and verify exactly one sample is written to |
174 // the expected bucket. | 174 // the expected bucket. |
175 metrics_provider_->ProvideInitialStabilityMetrics(nullptr); | 175 metrics_provider_->ProvideInitialStabilityMetrics(nullptr); |
176 histogram_tester.ExpectUniqueSample("Stability.MobileSessionShutdownType", | 176 histogram_tester.ExpectUniqueSample("Stability.MobileSessionShutdownType", |
177 expected_buckets[GetParam()], 1); | 177 expected_buckets[GetParam()], 1); |
178 } | 178 } |
179 | 179 |
180 INSTANTIATE_TEST_CASE_P(/* No InstantiationName */, | 180 INSTANTIATE_TEST_CASE_P(/* No InstantiationName */, |
181 MobileSessionShutdownMetricsProviderTest, | 181 MobileSessionShutdownMetricsProviderTest, |
182 testing::Range(0, 32)); | 182 testing::Range(0, 32)); |
OLD | NEW |