OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 SYNC_TEST_TRACKABLE_MOCK_INVALIDATION_H_ | 5 #ifndef SYNC_TEST_TRACKABLE_MOCK_INVALIDATION_H_ |
6 #define SYNC_TEST_TRACKABLE_MOCK_INVALIDATION_H_ | 6 #define SYNC_TEST_TRACKABLE_MOCK_INVALIDATION_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "sync/test/mock_invalidation.h" | 12 #include "sync/test/mock_invalidation.h" |
11 | 13 |
12 namespace syncer { | 14 namespace syncer { |
13 | 15 |
14 class MockInvalidationTracker; | 16 class MockInvalidationTracker; |
15 | 17 |
16 // A variant of MockInvalidation that supports acknowledgements. | 18 // A variant of MockInvalidation that supports acknowledgements. |
17 // | 19 // |
18 // With the help of a MockInvalidationTracker, this can be used to test | 20 // With the help of a MockInvalidationTracker, this can be used to test |
19 // sync's use of the Drop() and Acknowledge() methods. | 21 // sync's use of the Drop() and Acknowledge() methods. |
20 class TrackableMockInvalidation : public MockInvalidation { | 22 class TrackableMockInvalidation : public MockInvalidation { |
21 public: | 23 public: |
22 TrackableMockInvalidation(bool is_unknown_version, | 24 TrackableMockInvalidation(bool is_unknown_version, |
23 int64 version, | 25 int64_t version, |
24 const std::string& payload, | 26 const std::string& payload, |
25 MockInvalidationTracker* tracker, | 27 MockInvalidationTracker* tracker, |
26 int tracking_id); | 28 int tracking_id); |
27 ~TrackableMockInvalidation() override; | 29 ~TrackableMockInvalidation() override; |
28 | 30 |
29 // Forwards notice of the acknowledgement of this invalidation to the | 31 // Forwards notice of the acknowledgement of this invalidation to the |
30 // |tracker_|. | 32 // |tracker_|. |
31 void Acknowledge() override; | 33 void Acknowledge() override; |
32 | 34 |
33 // Forwards notice of the drop of this invalidation to the |tracker_|. | 35 // Forwards notice of the drop of this invalidation to the |tracker_|. |
(...skipping 13 matching lines...) Expand all Loading... |
47 // | 49 // |
48 // This is necessary in part because invalidations may be short lived; the | 50 // This is necessary in part because invalidations may be short lived; the |
49 // invalidation may be deleted by the time we want to make assertions about | 51 // invalidation may be deleted by the time we want to make assertions about |
50 // its state. | 52 // its state. |
51 int tracking_id_; | 53 int tracking_id_; |
52 }; | 54 }; |
53 | 55 |
54 } // namespace syncer | 56 } // namespace syncer |
55 | 57 |
56 #endif // SYNC_TEST_TRACKABLE_MOCK_INVALIDATION_H_ | 58 #endif // SYNC_TEST_TRACKABLE_MOCK_INVALIDATION_H_ |
OLD | NEW |