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

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

Issue 2492793004: Add TimeToScrollUpdateSwapBegin2 in RAPPOR (Closed)
Patch Set: add tests 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
« no previous file with comments | « components/rappor/test_rappor_service.h ('k') | content/browser/renderer_host/DEPS » ('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 #include "components/rappor/test_rappor_service.h" 5 #include "components/rappor/test_rappor_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 24 matching lines...) Expand all
35 Sample::SetStringField(field_name, value); 35 Sample::SetStringField(field_name, value);
36 } 36 }
37 37
38 void TestSample::SetFlagsField(const std::string& field_name, 38 void TestSample::SetFlagsField(const std::string& field_name,
39 uint64_t flags, 39 uint64_t flags,
40 size_t num_flags) { 40 size_t num_flags) {
41 shadow_.flag_fields[field_name] = flags; 41 shadow_.flag_fields[field_name] = flags;
42 Sample::SetFlagsField(field_name, flags, num_flags); 42 Sample::SetFlagsField(field_name, flags, num_flags);
43 } 43 }
44 44
45 void TestSample::SetUInt64Field(const std::string& field_name,
46 uint64_t value,
47 NoiseLevel noise_level) {
48 shadow_.uint64_fields[field_name] =
49 std::pair<std::uint64_t, NoiseLevel>(value, noise_level);
50 Sample::SetUInt64Field(field_name, value, noise_level);
51 }
52
45 TestSample::Shadow::Shadow(RapporType type) : type(type) {} 53 TestSample::Shadow::Shadow(RapporType type) : type(type) {}
46 54
47 TestSample::Shadow::Shadow(const TestSample::Shadow& other) { 55 TestSample::Shadow::Shadow(const TestSample::Shadow& other) {
48 type = other.type; 56 type = other.type;
49 flag_fields = other.flag_fields; 57 flag_fields = other.flag_fields;
50 string_fields = other.string_fields; 58 string_fields = other.string_fields;
59 uint64_fields = other.uint64_fields;
51 } 60 }
52 61
53 TestSample::Shadow::~Shadow() {} 62 TestSample::Shadow::~Shadow() {}
54 63
55 TestRapporServiceImpl::TestRapporServiceImpl() 64 TestRapporServiceImpl::TestRapporServiceImpl()
56 : RapporServiceImpl(&test_prefs_, 65 : RapporServiceImpl(&test_prefs_,
57 base::Bind(&MockIsIncognito, &is_incognito_)), 66 base::Bind(&MockIsIncognito, &is_incognito_)),
58 next_rotation_(base::TimeDelta()), 67 next_rotation_(base::TimeDelta()),
59 is_incognito_(false) { 68 is_incognito_(false) {
60 RegisterPrefs(test_prefs_.registry()); 69 RegisterPrefs(test_prefs_.registry());
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 void TestRapporServiceImpl::CancelNextLogRotation() { 138 void TestRapporServiceImpl::CancelNextLogRotation() {
130 next_rotation_ = base::TimeDelta(); 139 next_rotation_ = base::TimeDelta();
131 } 140 }
132 141
133 // Schedule the next call to OnLogInterval. 142 // Schedule the next call to OnLogInterval.
134 void TestRapporServiceImpl::ScheduleNextLogRotation(base::TimeDelta interval) { 143 void TestRapporServiceImpl::ScheduleNextLogRotation(base::TimeDelta interval) {
135 next_rotation_ = interval; 144 next_rotation_ = interval;
136 } 145 }
137 146
138 } // namespace rappor 147 } // namespace rappor
OLDNEW
« no previous file with comments | « components/rappor/test_rappor_service.h ('k') | content/browser/renderer_host/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698