Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: chrome/browser/invalidation/fake_invalidation_service.h

Issue 183803026: Clean up InvalidationService test infrastructure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "chrome/browser/invalidation/invalidation_service.h" 12 #include "chrome/browser/invalidation/invalidation_service.h"
13 #include "sync/notifier/invalidator_registrar.h" 13 #include "sync/notifier/invalidator_registrar.h"
14 #include "sync/notifier/mock_ack_handler.h" 14 #include "sync/notifier/mock_ack_handler.h"
15 15
16 namespace content {
17 class BrowserContext;
18 }
19
16 namespace syncer { 20 namespace syncer {
17 class Invalidation; 21 class Invalidation;
18 } 22 }
19 23
20 namespace invalidation { 24 namespace invalidation {
21 25
22 class InvalidationLogger; 26 class InvalidationLogger;
23 27
24 // An InvalidationService that emits invalidations only when 28 // An InvalidationService that emits invalidations only when
25 // its EmitInvalidationForTest method is called. 29 // its EmitInvalidationForTest method is called.
26 class FakeInvalidationService : public InvalidationService { 30 class FakeInvalidationService : public InvalidationService {
27 public: 31 public:
28 FakeInvalidationService(); 32 FakeInvalidationService();
29 virtual ~FakeInvalidationService(); 33 virtual ~FakeInvalidationService();
30 34
35 static BrowserContextKeyedService* Build(content::BrowserContext* context);
36
31 virtual void RegisterInvalidationHandler( 37 virtual void RegisterInvalidationHandler(
32 syncer::InvalidationHandler* handler) OVERRIDE; 38 syncer::InvalidationHandler* handler) OVERRIDE;
33 virtual void UpdateRegisteredInvalidationIds( 39 virtual void UpdateRegisteredInvalidationIds(
34 syncer::InvalidationHandler* handler, 40 syncer::InvalidationHandler* handler,
35 const syncer::ObjectIdSet& ids) OVERRIDE; 41 const syncer::ObjectIdSet& ids) OVERRIDE;
36 virtual void UnregisterInvalidationHandler( 42 virtual void UnregisterInvalidationHandler(
37 syncer::InvalidationHandler* handler) OVERRIDE; 43 syncer::InvalidationHandler* handler) OVERRIDE;
38 44
39 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE; 45 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE;
40 virtual std::string GetInvalidatorClientId() const OVERRIDE; 46 virtual std::string GetInvalidatorClientId() const OVERRIDE;
(...skipping 15 matching lines...) Expand all
56 std::string client_id_; 62 std::string client_id_;
57 syncer::InvalidatorRegistrar invalidator_registrar_; 63 syncer::InvalidatorRegistrar invalidator_registrar_;
58 syncer::MockAckHandler mock_ack_handler_; 64 syncer::MockAckHandler mock_ack_handler_;
59 65
60 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationService); 66 DISALLOW_COPY_AND_ASSIGN(FakeInvalidationService);
61 }; 67 };
62 68
63 } // namespace invalidation 69 } // namespace invalidation
64 70
65 #endif // CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_ 71 #endif // CHROME_BROWSER_INVALIDATION_FAKE_INVALIDATION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698