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

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

Issue 845863002: Add stricter tests for RapporService::LoadSecret (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « components/rappor/rappor_service_unittest.cc ('k') | components/rappor/test_rappor_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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
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_
OLDNEW
« no previous file with comments | « components/rappor/rappor_service_unittest.cc ('k') | components/rappor/test_rappor_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698