1 // Copyright (c) 2012 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.
5 #include "sync/notifier/fake_invalidator.h"
9 FakeInvalidator::FakeInvalidator() {}
11 FakeInvalidator::~FakeInvalidator() {}
13 bool FakeInvalidator::IsHandlerRegistered(InvalidationHandler
* handler
) const {
14 return registrar_
.IsHandlerRegisteredForTest(handler
);
17 ObjectIdSet
FakeInvalidator::GetRegisteredIds(
18 InvalidationHandler
* handler
) const {
19 return registrar_
.GetRegisteredIds(handler
);
22 const std::string
& FakeInvalidator::GetCredentialsEmail() const {
26 const std::string
& FakeInvalidator::GetCredentialsToken() const {
30 void FakeInvalidator::EmitOnInvalidatorStateChange(InvalidatorState state
) {
31 registrar_
.UpdateInvalidatorState(state
);
34 void FakeInvalidator::EmitOnIncomingInvalidation(
35 const ObjectIdInvalidationMap
& invalidation_map
) {
36 registrar_
.DispatchInvalidationsToHandlers(invalidation_map
);
39 void FakeInvalidator::RegisterHandler(InvalidationHandler
* handler
) {
40 registrar_
.RegisterHandler(handler
);
43 void FakeInvalidator::UpdateRegisteredIds(InvalidationHandler
* handler
,
44 const ObjectIdSet
& ids
) {
45 registrar_
.UpdateRegisteredIds(handler
, ids
);
48 void FakeInvalidator::UnregisterHandler(InvalidationHandler
* handler
) {
49 registrar_
.UnregisterHandler(handler
);
52 void FakeInvalidator::Acknowledge(const invalidation::ObjectId
& id
,
53 const AckHandle
& ack_handle
) {
57 InvalidatorState
FakeInvalidator::GetInvalidatorState() const {
58 return registrar_
.GetInvalidatorState();
61 void FakeInvalidator::UpdateCredentials(
62 const std::string
& email
, const std::string
& token
) {