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 SYNC_NOTIFIER_MOCK_ACK_HANDLER_H_ | 5 #ifndef SYNC_NOTIFIER_MOCK_ACK_HANDLER_H_ |
6 #define SYNC_NOTIFIER_MOCK_ACK_HANDLER_H_ | 6 #define SYNC_NOTIFIER_MOCK_ACK_HANDLER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "sync/base/sync_export.h" | 12 #include "sync/base/sync_export.h" |
13 #include "sync/internal_api/public/util/weak_handle.h" | 13 #include "sync/internal_api/public/util/weak_handle.h" |
14 #include "sync/notifier/ack_handler.h" | 14 #include "sync/notifier/ack_handler.h" |
15 | 15 |
16 namespace syncer { | 16 namespace syncer { |
17 | 17 |
18 class Invalidation; | 18 class Invalidation; |
19 | 19 |
20 // This AckHandler implementation colaborates with the FakeInvalidationService | 20 // This AckHandler implementation colaborates with the FakeInvalidationService |
21 // to enable unit tests to assert that invalidations are being acked properly. | 21 // to enable unit tests to assert that invalidations are being acked properly. |
22 class MockAckHandler | 22 class SYNC_EXPORT MockAckHandler |
23 : public AckHandler, | 23 : public AckHandler, |
24 public base::SupportsWeakPtr<MockAckHandler> { | 24 public base::SupportsWeakPtr<MockAckHandler> { |
25 public: | 25 public: |
26 MockAckHandler(); | 26 MockAckHandler(); |
27 virtual ~MockAckHandler(); | 27 virtual ~MockAckHandler(); |
28 | 28 |
29 // Sets up some internal state to track this invalidation, and modifies it so | 29 // Sets up some internal state to track this invalidation, and modifies it so |
30 // that its Acknowledge() and Drop() methods will route back to us. | 30 // that its Acknowledge() and Drop() methods will route back to us. |
31 void RegisterInvalidation(Invalidation* invalidation); | 31 void RegisterInvalidation(Invalidation* invalidation); |
32 | 32 |
(...skipping 22 matching lines...) Expand all Loading... |
55 WeakHandle<AckHandler> WeakHandleThis(); | 55 WeakHandle<AckHandler> WeakHandleThis(); |
56 | 56 |
57 InvalidationVector unsent_invalidations_; | 57 InvalidationVector unsent_invalidations_; |
58 InvalidationVector unacked_invalidations_; | 58 InvalidationVector unacked_invalidations_; |
59 InvalidationVector acked_invalidations_; | 59 InvalidationVector acked_invalidations_; |
60 }; | 60 }; |
61 | 61 |
62 } // namespace syncer | 62 } // namespace syncer |
63 | 63 |
64 #endif // SYNC_NOTIFIER_MOCK_ACK_HANDLER_H_ | 64 #endif // SYNC_NOTIFIER_MOCK_ACK_HANDLER_H_ |
OLD | NEW |