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

Side by Side Diff: chrome/browser/sync/test/integration/fake_server_invalidation_service.h

Issue 234113002: Use FakeServer-based invalidations for Sync tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
OLDNEW
(Empty)
1 // Copyright 2014 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 CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE_H_
7
8 #include <string>
9 #include <utility>
10
11 #include "base/basictypes.h"
12 #include "chrome/browser/invalidation/fake_invalidation_service.h"
13 #include "chrome/browser/invalidation/invalidation_auth_provider.h"
14 #include "chrome/browser/invalidation/invalidation_service.h"
15 #include "sync/internal_api/public/base/model_type.h"
16 #include "sync/notifier/mock_ack_handler.h"
17 #include "sync/test/fake_server/fake_server.h"
18
19 namespace content {
20 class BrowserContext;
21 }
22
23 namespace invalidation {
24 class InvalidationLogger;
25 }
26
27 namespace syncer {
28 class Invalidation;
29 }
30
31 namespace fake_server {
32
33 // An InvalidationService that is used in conjunction with FakeServer.
34 class FakeServerInvalidationService : public invalidation::InvalidationService,
35 public FakeServer::Observer {
36 public:
37 FakeServerInvalidationService();
38 virtual ~FakeServerInvalidationService();
39
40 static KeyedService* Build(content::BrowserContext* context);
41
42 virtual void RegisterInvalidationHandler(
43 syncer::InvalidationHandler* handler) OVERRIDE;
44 virtual void UpdateRegisteredInvalidationIds(
45 syncer::InvalidationHandler* handler,
46 const syncer::ObjectIdSet& ids) OVERRIDE;
47 virtual void UnregisterInvalidationHandler(
48 syncer::InvalidationHandler* handler) OVERRIDE;
49
50 virtual syncer::InvalidatorState GetInvalidatorState() const OVERRIDE;
51 virtual std::string GetInvalidatorClientId() const OVERRIDE;
52 virtual invalidation::InvalidationLogger* GetInvalidationLogger() OVERRIDE;
53 virtual void RequestDetailedStatus(
54 base::Callback<void(const base::DictionaryValue&)> caller) const OVERRIDE;
55 virtual invalidation::InvalidationAuthProvider* GetInvalidationAuthProvider()
56 OVERRIDE;
57
58 // FakeServer::Observer:
59 virtual void OnCommit(syncer::ModelTypeSet committed_model_types) OVERRIDE;
60
61 private:
62 // FakeServerInvalidationService delegates all InvalidationService behavior
63 // to FakeInvalidationService.
64 invalidation::FakeInvalidationService fake_invalidation_service_;
65
66 DISALLOW_COPY_AND_ASSIGN(FakeServerInvalidationService);
67 };
68
69 } // namespace fake_server
70
71 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_FAKE_SERVER_INVALIDATION_SERVICE _H_
72
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698