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/rappor/test_rappor_service.h" | 5 #include "components/rappor/test_rappor_service.h" |
6 | 6 |
7 #include "components/rappor/byte_vector_utils.h" | 7 #include "components/rappor/byte_vector_utils.h" |
8 #include "components/rappor/proto/rappor_metric.pb.h" | 8 #include "components/rappor/proto/rappor_metric.pb.h" |
9 #include "components/rappor/rappor_parameters.h" | 9 #include "components/rappor/rappor_parameters.h" |
| 10 #include "components/rappor/rappor_prefs.h" |
10 #include "components/rappor/test_log_uploader.h" | 11 #include "components/rappor/test_log_uploader.h" |
11 | 12 |
12 namespace rappor { | 13 namespace rappor { |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 bool MockIsIncognito(bool* is_incognito) { | 17 bool MockIsIncognito(bool* is_incognito) { |
17 return *is_incognito; | 18 return *is_incognito; |
18 } | 19 } |
19 | 20 |
(...skipping 16 matching lines...) Expand all Loading... |
36 int TestRapporService::GetReportsCount() { | 37 int TestRapporService::GetReportsCount() { |
37 RapporReports reports; | 38 RapporReports reports; |
38 ExportMetrics(&reports); | 39 ExportMetrics(&reports); |
39 return reports.report_size(); | 40 return reports.report_size(); |
40 } | 41 } |
41 | 42 |
42 void TestRapporService::GetReports(RapporReports* reports) { | 43 void TestRapporService::GetReports(RapporReports* reports) { |
43 ExportMetrics(reports); | 44 ExportMetrics(reports); |
44 } | 45 } |
45 | 46 |
46 int32_t TestRapporService::LoadCohortForTesting() { | |
47 return LoadCohort(); | |
48 } | |
49 | |
50 std::string TestRapporService::LoadSecretForTesting() { | |
51 return LoadSecret(); | |
52 } | |
53 | |
54 // Cancel the next call to OnLogInterval. | 47 // Cancel the next call to OnLogInterval. |
55 void TestRapporService::CancelNextLogRotation() { | 48 void TestRapporService::CancelNextLogRotation() { |
56 next_rotation_ = base::TimeDelta(); | 49 next_rotation_ = base::TimeDelta(); |
57 } | 50 } |
58 | 51 |
59 // Schedule the next call to OnLogInterval. | 52 // Schedule the next call to OnLogInterval. |
60 void TestRapporService::ScheduleNextLogRotation(base::TimeDelta interval) { | 53 void TestRapporService::ScheduleNextLogRotation(base::TimeDelta interval) { |
61 next_rotation_ = interval; | 54 next_rotation_ = interval; |
62 } | 55 } |
63 | 56 |
64 } // namespace rappor | 57 } // namespace rappor |
OLD | NEW |