| 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 #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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/prefs/testing_pref_service.h" | 10 #include "base/prefs/testing_pref_service.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // Gets the number of reports that would be uploaded by this service. | 25 // Gets the number of reports that would be uploaded by this service. |
| 26 // This also clears the internal map of metrics as a biproduct, so if | 26 // This also clears the internal map of metrics as a biproduct, so if |
| 27 // comparing numbers of reports, the comparison should be from the last time | 27 // comparing numbers of reports, the comparison should be from the last time |
| 28 // GetReportsCount() was called (not from the beginning of the test). | 28 // GetReportsCount() was called (not from the beginning of the test). |
| 29 int GetReportsCount(); | 29 int GetReportsCount(); |
| 30 | 30 |
| 31 // Gets the reports proto that would be uploaded. | 31 // Gets the reports proto that would be uploaded. |
| 32 // This clears the internal map of metrics. | 32 // This clears the internal map of metrics. |
| 33 void GetReports(RapporReports* reports); | 33 void GetReports(RapporReports* reports); |
| 34 | 34 |
| 35 // Loads the cohort from TestingPrefService. | |
| 36 int32_t LoadCohortForTesting(); | |
| 37 | |
| 38 // Loads the secret from TestingPrefService. | |
| 39 std::string LoadSecretForTesting(); | |
| 40 | |
| 41 void set_is_incognito(bool is_incognito) { is_incognito_ = is_incognito; } | 35 void set_is_incognito(bool is_incognito) { is_incognito_ = is_incognito; } |
| 42 | 36 |
| 43 TestingPrefServiceSimple* test_prefs() { return &test_prefs_; } | 37 TestingPrefServiceSimple* test_prefs() { return &test_prefs_; } |
| 44 | 38 |
| 45 TestLogUploader* test_uploader() { return test_uploader_; } | 39 TestLogUploader* test_uploader() { return test_uploader_; } |
| 46 | 40 |
| 47 base::TimeDelta next_rotation() { return next_rotation_; } | 41 base::TimeDelta next_rotation() { return next_rotation_; } |
| 48 | 42 |
| 49 protected: | 43 protected: |
| 50 // Cancels the next call to OnLogInterval. | 44 // Cancels the next call to OnLogInterval. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 64 | 58 |
| 65 // Sets this to true to mock incognito state. | 59 // Sets this to true to mock incognito state. |
| 66 bool is_incognito_; | 60 bool is_incognito_; |
| 67 | 61 |
| 68 DISALLOW_COPY_AND_ASSIGN(TestRapporService); | 62 DISALLOW_COPY_AND_ASSIGN(TestRapporService); |
| 69 }; | 63 }; |
| 70 | 64 |
| 71 } // namespace rappor | 65 } // namespace rappor |
| 72 | 66 |
| 73 #endif // COMPONENTS_RAPPOR_TEST_RAPPOR_SERVICE_H_ | 67 #endif // COMPONENTS_RAPPOR_TEST_RAPPOR_SERVICE_H_ |
| OLD | NEW |