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 <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" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 bool HasCrashLogs() override { return has_crash_logs_; } | 48 bool HasCrashLogs() override { return has_crash_logs_; } |
49 bool HasUploadedCrashReportsInBackground() override { | 49 bool HasUploadedCrashReportsInBackground() override { |
50 return has_uploaded_crash_reports_in_background_; | 50 return has_uploaded_crash_reports_in_background_; |
51 } | 51 } |
52 bool ReceivedMemoryWarningBeforeLastShutdown() override { | 52 bool ReceivedMemoryWarningBeforeLastShutdown() override { |
53 return received_memory_warning_before_last_shutdown_; | 53 return received_memory_warning_before_last_shutdown_; |
54 } | 54 } |
55 | 55 |
56 private: | 56 private: |
57 bool is_first_launch_after_upgrade_; | 57 bool is_first_launch_after_upgrade_; |
58 bool was_last_shutdown_clean_; | |
59 bool has_crash_logs_; | 58 bool has_crash_logs_; |
60 bool has_uploaded_crash_reports_in_background_; | 59 bool has_uploaded_crash_reports_in_background_; |
61 bool received_memory_warning_before_last_shutdown_; | 60 bool received_memory_warning_before_last_shutdown_; |
62 | 61 |
63 DISALLOW_COPY_AND_ASSIGN(MobileSessionShutdownMetricsProviderForTesting); | 62 DISALLOW_COPY_AND_ASSIGN(MobileSessionShutdownMetricsProviderForTesting); |
64 }; | 63 }; |
65 | 64 |
66 class MobileSessionShutdownMetricsProviderTest | 65 class MobileSessionShutdownMetricsProviderTest |
67 : public testing::TestWithParam<int> { | 66 : public testing::TestWithParam<int> { |
68 public: | 67 public: |
(...skipping 104 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 | 172 // Now call the method under test and verify exactly one sample is written to |
174 // the expected bucket. | 173 // the expected bucket. |
175 metrics_provider_->ProvideInitialStabilityMetrics(nullptr); | 174 metrics_provider_->ProvideInitialStabilityMetrics(nullptr); |
176 histogram_tester.ExpectUniqueSample("Stability.MobileSessionShutdownType", | 175 histogram_tester.ExpectUniqueSample("Stability.MobileSessionShutdownType", |
177 expected_buckets[GetParam()], 1); | 176 expected_buckets[GetParam()], 1); |
178 } | 177 } |
179 | 178 |
180 INSTANTIATE_TEST_CASE_P(/* No InstantiationName */, | 179 INSTANTIATE_TEST_CASE_P(/* No InstantiationName */, |
181 MobileSessionShutdownMetricsProviderTest, | 180 MobileSessionShutdownMetricsProviderTest, |
182 testing::Range(0, 32)); | 181 testing::Range(0, 32)); |
OLD | NEW |