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"
7 #include "sync/notifier/object_id_invalidation_map.h"
11 FakeInvalidator::FakeInvalidator() {}
13 FakeInvalidator::~FakeInvalidator() {}
15 bool FakeInvalidator::IsHandlerRegistered(InvalidationHandler
* handler
) const {
16 return registrar_
.IsHandlerRegisteredForTest(handler
);
19 ObjectIdSet
FakeInvalidator::GetRegisteredIds(
20 InvalidationHandler
* handler
) const {
21 return registrar_
.GetRegisteredIds(handler
);
24 const std::string
& FakeInvalidator::GetCredentialsEmail() const {
28 const std::string
& FakeInvalidator::GetCredentialsToken() const {
32 void FakeInvalidator::EmitOnInvalidatorStateChange(InvalidatorState state
) {
33 registrar_
.UpdateInvalidatorState(state
);
36 void FakeInvalidator::EmitOnIncomingInvalidation(
37 const ObjectIdInvalidationMap
& invalidation_map
) {
38 registrar_
.DispatchInvalidationsToHandlers(invalidation_map
);
41 void FakeInvalidator::RegisterHandler(InvalidationHandler
* handler
) {
42 registrar_
.RegisterHandler(handler
);
45 void FakeInvalidator::UpdateRegisteredIds(InvalidationHandler
* handler
,
46 const ObjectIdSet
& ids
) {
47 registrar_
.UpdateRegisteredIds(handler
, ids
);
50 void FakeInvalidator::UnregisterHandler(InvalidationHandler
* handler
) {
51 registrar_
.UnregisterHandler(handler
);
54 InvalidatorState
FakeInvalidator::GetInvalidatorState() const {
55 return registrar_
.GetInvalidatorState();
58 void FakeInvalidator::UpdateCredentials(
59 const std::string
& email
, const std::string
& token
) {