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/cloned_install_detector.h" | 5 #include "components/metrics/cloned_install_detector.h" |
6 | 6 |
7 #include "base/prefs/testing_pref_service.h" | |
8 #include "components/metrics/machine_id_provider.h" | 7 #include "components/metrics/machine_id_provider.h" |
9 #include "components/metrics/metrics_pref_names.h" | 8 #include "components/metrics/metrics_pref_names.h" |
10 #include "components/metrics/metrics_state_manager.h" | 9 #include "components/metrics/metrics_state_manager.h" |
| 10 #include "components/prefs/testing_pref_service.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace metrics { | 13 namespace metrics { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 const std::string kTestRawId = "test"; | 17 const std::string kTestRawId = "test"; |
18 // Hashed machine id for |kTestRawId|. | 18 // Hashed machine id for |kTestRawId|. |
19 const int kTestHashedId = 2216819; | 19 const int kTestHashedId = 2216819; |
20 | 20 |
(...skipping 23 matching lines...) Expand all Loading... |
44 | 44 |
45 scoped_ptr<ClonedInstallDetector> detector( | 45 scoped_ptr<ClonedInstallDetector> detector( |
46 new ClonedInstallDetector(MachineIdProvider::CreateInstance())); | 46 new ClonedInstallDetector(MachineIdProvider::CreateInstance())); |
47 | 47 |
48 detector->SaveMachineId(&prefs, kTestRawId); | 48 detector->SaveMachineId(&prefs, kTestRawId); |
49 | 49 |
50 EXPECT_TRUE(prefs.GetBoolean(prefs::kMetricsResetIds)); | 50 EXPECT_TRUE(prefs.GetBoolean(prefs::kMetricsResetIds)); |
51 } | 51 } |
52 | 52 |
53 } // namespace metrics | 53 } // namespace metrics |
OLD | NEW |