OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/sync/user_events/fake_user_event_service.h" |
| 6 |
| 7 using sync_pb::UserEventSpecifics; |
| 8 |
| 9 namespace syncer { |
| 10 |
| 11 FakeUserEventService::FakeUserEventService() {} |
| 12 |
| 13 FakeUserEventService::~FakeUserEventService() {} |
| 14 |
| 15 void FakeUserEventService::RecordUserEvent( |
| 16 std::unique_ptr<UserEventSpecifics> specifics) { |
| 17 DCHECK(specifics); |
| 18 RecordUserEvent(*specifics); |
| 19 } |
| 20 |
| 21 void FakeUserEventService::RecordUserEvent( |
| 22 const UserEventSpecifics& specifics) { |
| 23 recorded_user_events_.push_back(specifics); |
| 24 } |
| 25 |
| 26 base::WeakPtr<ModelTypeSyncBridge> FakeUserEventService::GetSyncBridge() { |
| 27 return base::WeakPtr<ModelTypeSyncBridge>(); |
| 28 } |
| 29 |
| 30 void FakeUserEventService::RegisterDependentFieldTrial( |
| 31 const std::string& trial_name, |
| 32 UserEventSpecifics::EventCase event_case) { |
| 33 registered_dependent_field_trials_[trial_name].insert(event_case); |
| 34 } |
| 35 |
| 36 const std::vector<UserEventSpecifics>& |
| 37 FakeUserEventService::GetRecordedUserEvents() const { |
| 38 return recorded_user_events_; |
| 39 } |
| 40 |
| 41 const std::map<std::string, std::set<sync_pb::UserEventSpecifics::EventCase>>& |
| 42 FakeUserEventService::GetRegisteredDependentFieldTrials() const { |
| 43 return registered_dependent_field_trials_; |
| 44 } |
| 45 |
| 46 } // namespace syncer |
OLD | NEW |