Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: ios/chrome/browser/metrics/mobile_session_shutdown_metrics_provider_unittest.mm

Issue 2513993002: [ObjC ARC] Converts ios/chrome/browser/metrics:unit_tests to ARC.Automatically generated ARCMigra… (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/metrics/user_metrics.h" 11 #include "base/metrics/user_metrics.h"
12 #include "base/test/histogram_tester.h" 12 #include "base/test/histogram_tester.h"
13 #include "base/test/test_simple_task_runner.h" 13 #include "base/test/test_simple_task_runner.h"
14 #include "components/metrics/metrics_pref_names.h" 14 #include "components/metrics/metrics_pref_names.h"
15 #include "components/metrics/metrics_service.h" 15 #include "components/metrics/metrics_service.h"
16 #include "components/metrics/metrics_state_manager.h" 16 #include "components/metrics/metrics_state_manager.h"
17 #include "components/metrics/test_enabled_state_provider.h" 17 #include "components/metrics/test_enabled_state_provider.h"
18 #include "components/metrics/test_metrics_service_client.h" 18 #include "components/metrics/test_metrics_service_client.h"
19 #include "components/prefs/testing_pref_service.h" 19 #include "components/prefs/testing_pref_service.h"
20 #include "testing/gtest/include/gtest/gtest-param-test.h" 20 #include "testing/gtest/include/gtest/gtest-param-test.h"
21 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
22 22
23 #if !defined(__has_feature) || !__has_feature(objc_arc)
24 #error "This file requires ARC support."
25 #endif
26
23 // An MobileSessionShutdownMetricsProvider that returns fake values for the last 27 // An MobileSessionShutdownMetricsProvider that returns fake values for the last
24 // session environment query methods. 28 // session environment query methods.
25 class MobileSessionShutdownMetricsProviderForTesting 29 class MobileSessionShutdownMetricsProviderForTesting
26 : public MobileSessionShutdownMetricsProvider { 30 : public MobileSessionShutdownMetricsProvider {
27 public: 31 public:
28 explicit MobileSessionShutdownMetricsProviderForTesting( 32 explicit MobileSessionShutdownMetricsProviderForTesting(
29 metrics::MetricsService* metrics_service) 33 metrics::MetricsService* metrics_service)
30 : MobileSessionShutdownMetricsProvider(metrics_service) {} 34 : MobileSessionShutdownMetricsProvider(metrics_service) {}
31 35
32 void set_is_first_launch_after_upgrade(bool value) { 36 void set_is_first_launch_after_upgrade(bool value) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // Now call the method under test and verify exactly one sample is written to 176 // Now call the method under test and verify exactly one sample is written to
173 // the expected bucket. 177 // the expected bucket.
174 metrics_provider_->ProvideInitialStabilityMetrics(nullptr); 178 metrics_provider_->ProvideInitialStabilityMetrics(nullptr);
175 histogram_tester.ExpectUniqueSample("Stability.MobileSessionShutdownType", 179 histogram_tester.ExpectUniqueSample("Stability.MobileSessionShutdownType",
176 expected_buckets[GetParam()], 1); 180 expected_buckets[GetParam()], 1);
177 } 181 }
178 182
179 INSTANTIATE_TEST_CASE_P(/* No InstantiationName */, 183 INSTANTIATE_TEST_CASE_P(/* No InstantiationName */,
180 MobileSessionShutdownMetricsProviderTest, 184 MobileSessionShutdownMetricsProviderTest,
181 testing::Range(0, 32)); 185 testing::Range(0, 32));
OLDNEW
« no previous file with comments | « ios/chrome/browser/metrics/BUILD.gn ('k') | ios/chrome/browser/metrics/previous_session_info_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698