| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ |
| 6 #define CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ | 6 #define CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 class InvalidationLogger; | 25 class InvalidationLogger; |
| 26 | 26 |
| 27 // An InvalidationService that emits invalidations only when | 27 // An InvalidationService that emits invalidations only when |
| 28 // its EmitInvalidationForTest method is called. | 28 // its EmitInvalidationForTest method is called. |
| 29 class FakeInvalidationService : public InvalidationService { | 29 class FakeInvalidationService : public InvalidationService { |
| 30 public: | 30 public: |
| 31 FakeInvalidationService(); | 31 FakeInvalidationService(); |
| 32 virtual ~FakeInvalidationService(); | 32 virtual ~FakeInvalidationService(); |
| 33 | 33 |
| 34 virtual void RegisterInvalidationHandler( | 34 virtual void RegisterInvalidationHandler( |
| 35 syncer::InvalidationHandler* handler) OVERRIDE; | 35 syncer::InvalidationHandler* handler) override; |
| 36 virtual void UpdateRegisteredInvalidationIds( | 36 virtual void UpdateRegisteredInvalidationIds( |
| 37 syncer::InvalidationHandler* handler, | 37 syncer::InvalidationHandler* handler, |
| 38 const syncer::ObjectIdSet& ids) OVERRIDE; | 38 const syncer::ObjectIdSet& ids) override; |
| 39 virtual void UnregisterInvalidationHandler( | 39 virtual void UnregisterInvalidationHandler( |
| 40 syncer::InvalidationHandler* handler) OVERRIDE; | 40 syncer::InvalidationHandler* handler) override; |
| 41 | 41 |
| 42 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; | 42 virtual syncer::InvalidatorState GetInvalidatorState() const override; |
| 43 virtual std::string GetInvalidatorClientId() const OVERRIDE; | 43 virtual std::string GetInvalidatorClientId() const override; |
| 44 virtual InvalidationLogger* GetInvalidationLogger() OVERRIDE; | 44 virtual InvalidationLogger* GetInvalidationLogger() override; |
| 45 virtual void RequestDetailedStatus( | 45 virtual void RequestDetailedStatus( |
| 46 base::Callback<void(const base::DictionaryValue&)> caller) const OVERRIDE; | 46 base::Callback<void(const base::DictionaryValue&)> caller) const override; |
| 47 virtual IdentityProvider* GetIdentityProvider() OVERRIDE; | 47 virtual IdentityProvider* GetIdentityProvider() override; |
| 48 | 48 |
| 49 void SetInvalidatorState(syncer::InvalidatorState state); | 49 void SetInvalidatorState(syncer::InvalidatorState state); |
| 50 | 50 |
| 51 const syncer::InvalidatorRegistrar& invalidator_registrar() const { | 51 const syncer::InvalidatorRegistrar& invalidator_registrar() const { |
| 52 return invalidator_registrar_; | 52 return invalidator_registrar_; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void EmitInvalidationForTest(const syncer::Invalidation& invalidation); | 55 void EmitInvalidationForTest(const syncer::Invalidation& invalidation); |
| 56 | 56 |
| 57 // Emitted invalidations will be hooked up to this AckHandler. Clients can | 57 // Emitted invalidations will be hooked up to this AckHandler. Clients can |
| 58 // query it to assert the invalidaitons are being acked properly. | 58 // query it to assert the invalidaitons are being acked properly. |
| 59 syncer::MockAckHandler* GetMockAckHandler(); | 59 syncer::MockAckHandler* GetMockAckHandler(); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 std::string client_id_; | 62 std::string client_id_; |
| 63 syncer::InvalidatorRegistrar invalidator_registrar_; | 63 syncer::InvalidatorRegistrar invalidator_registrar_; |
| 64 syncer::MockAckHandler mock_ack_handler_; | 64 syncer::MockAckHandler mock_ack_handler_; |
| 65 FakeProfileOAuth2TokenService token_service_; | 65 FakeProfileOAuth2TokenService token_service_; |
| 66 FakeIdentityProvider identity_provider_; | 66 FakeIdentityProvider identity_provider_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationService); | 68 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationService); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace invalidation | 71 } // namespace invalidation |
| 72 | 72 |
| 73 #endif // CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ | 73 #endif // CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ |
| OLD | NEW |