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

Side by Side Diff: sync/test/mock_invalidation.h

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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
« no previous file with comments | « sync/test/local_sync_test_server.cc ('k') | sync/test/mock_invalidation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 SYNC_TEST_MOCK_INVALIDATION_H_
6 #define SYNC_TEST_MOCK_INVALIDATION_H_
7
8 #include <stdint.h>
9
10 #include <memory>
11 #include <string>
12
13 #include "sync/internal_api/public/base/invalidation_interface.h"
14
15 namespace syncer {
16
17 // An InvalidationInterface used by sync for testing.
18 // It does not support any form of acknowledgements.
19 class MockInvalidation : public InvalidationInterface {
20 public:
21 // Helpers to build new MockInvalidations.
22 static std::unique_ptr<MockInvalidation> BuildUnknownVersion();
23 static std::unique_ptr<MockInvalidation> Build(int64_t version,
24 const std::string& payload);
25
26 ~MockInvalidation() override;
27
28 // Implementation of InvalidationInterface.
29 bool IsUnknownVersion() const override;
30 const std::string& GetPayload() const override;
31 int64_t GetVersion() const override;
32 void Acknowledge() override;
33 void Drop() override;
34
35 protected:
36 MockInvalidation(bool is_unknown_version,
37 int64_t version,
38 const std::string& payload);
39
40 // Whether or not this is an 'unknown version' invalidation.
41 const bool is_unknown_version_;
42
43 // The version of this invalidation. Valid only if !is_unknown_version_.
44 const int64_t version_;
45
46 // The payload of this invalidation. Valid only if !is_unknown_version_.
47 const std::string payload_;
48 };
49
50 } // namespace syncer
51
52 #endif // SYNC_TEST_MOCK_INVALIDATION_H_
OLDNEW
« no previous file with comments | « sync/test/local_sync_test_server.cc ('k') | sync/test/mock_invalidation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698