OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/metrics/metrics_state_manager.h" | 5 #include "components/metrics/metrics_state_manager.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <string> | 10 #include <string> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/prefs/testing_pref_service.h" | |
17 #include "components/metrics/client_info.h" | 16 #include "components/metrics/client_info.h" |
18 #include "components/metrics/metrics_pref_names.h" | 17 #include "components/metrics/metrics_pref_names.h" |
19 #include "components/metrics/metrics_service.h" | 18 #include "components/metrics/metrics_service.h" |
20 #include "components/metrics/metrics_switches.h" | 19 #include "components/metrics/metrics_switches.h" |
| 20 #include "components/prefs/testing_pref_service.h" |
21 #include "components/variations/caching_permuted_entropy_provider.h" | 21 #include "components/variations/caching_permuted_entropy_provider.h" |
22 #include "components/variations/pref_names.h" | 22 #include "components/variations/pref_names.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 | 24 |
25 namespace metrics { | 25 namespace metrics { |
26 | 26 |
27 class MetricsStateManagerTest : public testing::Test { | 27 class MetricsStateManagerTest : public testing::Test { |
28 public: | 28 public: |
29 MetricsStateManagerTest() : is_metrics_reporting_enabled_(false) { | 29 MetricsStateManagerTest() : is_metrics_reporting_enabled_(false) { |
30 MetricsService::RegisterPrefs(prefs_.registry()); | 30 MetricsService::RegisterPrefs(prefs_.registry()); |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 377 |
378 // The metrics-reporting-enabled date will be reset to Now(). | 378 // The metrics-reporting-enabled date will be reset to Now(). |
379 EXPECT_GE(prefs_.GetInt64(prefs::kMetricsReportingEnabledTimestamp), | 379 EXPECT_GE(prefs_.GetInt64(prefs::kMetricsReportingEnabledTimestamp), |
380 previous_client_info->reporting_enabled_date); | 380 previous_client_info->reporting_enabled_date); |
381 | 381 |
382 stored_client_info_backup_.reset(); | 382 stored_client_info_backup_.reset(); |
383 } | 383 } |
384 } | 384 } |
385 | 385 |
386 } // namespace metrics | 386 } // namespace metrics |
OLD | NEW |