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. 4 5 #ifndef SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_OBSERVER_H_ 6 #define SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_OBSERVER_H_ 7 8 #include <string> 9 10 #include "base/basictypes.h" 11 #include "base/compiler_specific.h" 12 #include "sync/notifier/invalidation_handler.h" 13 #include "sync/notifier/object_id_invalidation_map.h" 14 15 namespace syncer { 16 17 class FakeInvalidationHandler : public InvalidationHandler { 18 public: 19 FakeInvalidationHandler(); 20 virtual ~FakeInvalidationHandler(); 21 22 InvalidatorState GetInvalidatorState() const; 23 const ObjectIdInvalidationMap& GetLastInvalidationMap() const; 24 int GetInvalidationCount() const; 25 26 // InvalidationHandler implementation. 27 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; 28 virtual void OnIncomingInvalidation( 29 const ObjectIdInvalidationMap& invalidation_map) OVERRIDE; 30 31 private: 32 InvalidatorState state_; 33 ObjectIdInvalidationMap last_invalidation_map_; 34 int invalidation_count_; 35 36 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationHandler); 37 }; 38 39 } // namespace syncer 40 41 #endif // SYNC_NOTIFIER_FAKE_SYNC_NOTIFIER_OBSERVER_H_ 42