OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef COMPONENTS_UKM_TEST_UKM_SERVICE_H_ | 5 #ifndef COMPONENTS_UKM_TEST_UKM_SERVICE_H_ |
6 #define COMPONENTS_UKM_TEST_UKM_SERVICE_H_ | 6 #define COMPONENTS_UKM_TEST_UKM_SERVICE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 DISALLOW_COPY_AND_ASSIGN(TestUkmService); | 30 DISALLOW_COPY_AND_ASSIGN(TestUkmService); |
31 }; | 31 }; |
32 | 32 |
33 // Convenience harness used for testing; creates a TestUkmService and | 33 // Convenience harness used for testing; creates a TestUkmService and |
34 // supplies it with a prefs service with a longer lifespan. | 34 // supplies it with a prefs service with a longer lifespan. |
35 class UkmServiceTestingHarness { | 35 class UkmServiceTestingHarness { |
36 public: | 36 public: |
37 UkmServiceTestingHarness(); | 37 UkmServiceTestingHarness(); |
38 virtual ~UkmServiceTestingHarness(); | 38 virtual ~UkmServiceTestingHarness(); |
39 | 39 |
40 const TestUkmService& test_ukm_service() const { | 40 TestUkmService* test_ukm_service() { return test_ukm_service_.get(); } |
41 return *test_ukm_service_.get(); | |
42 } | |
43 | 41 |
44 private: | 42 private: |
45 TestingPrefServiceSimple test_prefs_; | 43 TestingPrefServiceSimple test_prefs_; |
46 std::unique_ptr<TestUkmService> test_ukm_service_; | 44 std::unique_ptr<TestUkmService> test_ukm_service_; |
47 | 45 |
48 DISALLOW_COPY_AND_ASSIGN(UkmServiceTestingHarness); | 46 DISALLOW_COPY_AND_ASSIGN(UkmServiceTestingHarness); |
49 }; | 47 }; |
50 | 48 |
51 } // namespace ukm | 49 } // namespace ukm |
52 | 50 |
53 #endif // COMPONENTS_UKM_TEST_UKM_SERVICE_H_ | 51 #endif // COMPONENTS_UKM_TEST_UKM_SERVICE_H_ |
OLD | NEW |