| 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 <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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 TestRapporServiceImpl::TestRapporServiceImpl() | 64 TestRapporServiceImpl::TestRapporServiceImpl() |
| 65 : RapporServiceImpl(&test_prefs_, | 65 : RapporServiceImpl(&test_prefs_, |
| 66 base::Bind(&MockIsIncognito, &is_incognito_)), | 66 base::Bind(&MockIsIncognito, &is_incognito_)), |
| 67 next_rotation_(base::TimeDelta()), | 67 next_rotation_(base::TimeDelta()), |
| 68 is_incognito_(false) { | 68 is_incognito_(false) { |
| 69 RegisterPrefs(test_prefs_.registry()); | 69 RegisterPrefs(test_prefs_.registry()); |
| 70 test_uploader_ = new TestLogUploader(); | 70 test_uploader_ = new TestLogUploader(); |
| 71 InitializeInternal(base::WrapUnique(test_uploader_), 0, | 71 InitializeInternal(base::WrapUnique(test_uploader_), 0, |
| 72 HmacByteVectorGenerator::GenerateEntropyInput()); | 72 HmacByteVectorGenerator::GenerateEntropyInput()); |
| 73 Update(UMA_RAPPOR_GROUP | SAFEBROWSING_RAPPOR_GROUP, true); | 73 Update(true, true); |
| 74 } | 74 } |
| 75 | 75 |
| 76 TestRapporServiceImpl::~TestRapporServiceImpl() {} | 76 TestRapporServiceImpl::~TestRapporServiceImpl() {} |
| 77 | 77 |
| 78 std::unique_ptr<Sample> TestRapporServiceImpl::CreateSample(RapporType type) { | 78 std::unique_ptr<Sample> TestRapporServiceImpl::CreateSample(RapporType type) { |
| 79 std::unique_ptr<TestSample> test_sample(new TestSample(type)); | 79 std::unique_ptr<TestSample> test_sample(new TestSample(type)); |
| 80 return std::move(test_sample); | 80 return std::move(test_sample); |
| 81 } | 81 } |
| 82 | 82 |
| 83 // Intercepts the sample being recorded and saves it in a test structure. | 83 // Intercepts the sample being recorded and saves it in a test structure. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 void TestRapporServiceImpl::CancelNextLogRotation() { | 138 void TestRapporServiceImpl::CancelNextLogRotation() { |
| 139 next_rotation_ = base::TimeDelta(); | 139 next_rotation_ = base::TimeDelta(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 // Schedule the next call to OnLogInterval. | 142 // Schedule the next call to OnLogInterval. |
| 143 void TestRapporServiceImpl::ScheduleNextLogRotation(base::TimeDelta interval) { | 143 void TestRapporServiceImpl::ScheduleNextLogRotation(base::TimeDelta interval) { |
| 144 next_rotation_ = interval; | 144 next_rotation_ = interval; |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace rappor | 147 } // namespace rappor |
| OLD | NEW |