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

Side by Side Diff: components/rappor/test_rappor_service.h

Issue 2510803003: Pass RapporService to content/browser/ (Closed)
Patch Set: Fix an Android compile error Created 4 years 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 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 #ifndef COMPONENTS_RAPPOR_TEST_RAPPOR_SERVICE_H_ 5 #ifndef COMPONENTS_RAPPOR_TEST_RAPPOR_SERVICE_H_
6 #define COMPONENTS_RAPPOR_TEST_RAPPOR_SERVICE_H_ 6 #define COMPONENTS_RAPPOR_TEST_RAPPOR_SERVICE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // and examined to check that metrics were recorded. It assumes the most 52 // and examined to check that metrics were recorded. It assumes the most
53 // permissive settings so that any metric can be recorded. 53 // permissive settings so that any metric can be recorded.
54 class TestRapporService : public RapporService { 54 class TestRapporService : public RapporService {
55 public: 55 public:
56 TestRapporService(); 56 TestRapporService();
57 57
58 ~TestRapporService() override; 58 ~TestRapporService() override;
59 59
60 // RapporService: 60 // RapporService:
61 std::unique_ptr<Sample> CreateSample(RapporType type) override; 61 std::unique_ptr<Sample> CreateSample(RapporType type) override;
62 void RecordSampleObj(const std::string& metric_name,
63 std::unique_ptr<Sample> sample) override;
64 void RecordSample(const std::string& metric_name, 62 void RecordSample(const std::string& metric_name,
65 RapporType type, 63 std::unique_ptr<Sample> sample) override;
66 const std::string& sample) override; 64 void RecordSampleString(const std::string& metric_name,
65 RapporType type,
66 const std::string& sample) override;
67 67
68 // Gets the number of reports that would be uploaded by this service. 68 // Gets the number of reports that would be uploaded by this service.
69 // This also clears the internal map of metrics as a biproduct, so if 69 // This also clears the internal map of metrics as a biproduct, so if
70 // comparing numbers of reports, the comparison should be from the last time 70 // comparing numbers of reports, the comparison should be from the last time
71 // GetReportsCount() was called (not from the beginning of the test). 71 // GetReportsCount() was called (not from the beginning of the test).
72 int GetReportsCount(); 72 int GetReportsCount();
73 73
74 // Gets the reports proto that would be uploaded. 74 // Gets the reports proto that would be uploaded.
75 // This clears the internal map of metrics. 75 // This clears the internal map of metrics.
76 void GetReports(RapporReports* reports); 76 void GetReports(RapporReports* reports);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // Sets this to true to mock incognito state. 129 // Sets this to true to mock incognito state.
130 bool is_incognito_; 130 bool is_incognito_;
131 131
132 DISALLOW_COPY_AND_ASSIGN(TestRapporService); 132 DISALLOW_COPY_AND_ASSIGN(TestRapporService);
133 }; 133 };
134 134
135 } // namespace rappor 135 } // namespace rappor
136 136
137 #endif // COMPONENTS_RAPPOR_TEST_RAPPOR_SERVICE_H_ 137 #endif // COMPONENTS_RAPPOR_TEST_RAPPOR_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698