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

Side by Side Diff: components/ukm/test_ukm_service.h

Issue 2654843003: Added UkmPageLoadMetricsObserver which sends top-level metrics to UKM (Closed)
Patch Set: Test fix Created 3 years, 10 months 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 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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698