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 #include "sync/internal_api/public/attachments/attachment_store_handle.h" | 5 #include "sync/internal_api/public/attachments/attachment_store_handle.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 : read_called_(read_called), | 28 : read_called_(read_called), |
29 write_called_(write_called), | 29 write_called_(write_called), |
30 drop_called_(drop_called), | 30 drop_called_(drop_called), |
31 dtor_called_(dtor_called) {} | 31 dtor_called_(dtor_called) {} |
32 | 32 |
33 virtual ~MockAttachmentStore() { | 33 virtual ~MockAttachmentStore() { |
34 dtor_called_.Run(); | 34 dtor_called_.Run(); |
35 } | 35 } |
36 | 36 |
37 virtual void Read(const AttachmentIdList& ids, | 37 virtual void Read(const AttachmentIdList& ids, |
38 const ReadCallback& callback) OVERRIDE { | 38 const ReadCallback& callback) override { |
39 read_called_.Run(); | 39 read_called_.Run(); |
40 } | 40 } |
41 | 41 |
42 virtual void Write(const AttachmentList& attachments, | 42 virtual void Write(const AttachmentList& attachments, |
43 const WriteCallback& callback) OVERRIDE { | 43 const WriteCallback& callback) override { |
44 write_called_.Run(); | 44 write_called_.Run(); |
45 } | 45 } |
46 | 46 |
47 virtual void Drop(const AttachmentIdList& ids, | 47 virtual void Drop(const AttachmentIdList& ids, |
48 const DropCallback& callback) OVERRIDE { | 48 const DropCallback& callback) override { |
49 drop_called_.Run(); | 49 drop_called_.Run(); |
50 } | 50 } |
51 | 51 |
52 base::Closure read_called_; | 52 base::Closure read_called_; |
53 base::Closure write_called_; | 53 base::Closure write_called_; |
54 base::Closure drop_called_; | 54 base::Closure drop_called_; |
55 base::Closure dtor_called_; | 55 base::Closure dtor_called_; |
56 }; | 56 }; |
57 | 57 |
58 } // namespace | 58 } // namespace |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 // Releasing referehce to AttachmentStoreHandle should result in | 140 // Releasing referehce to AttachmentStoreHandle should result in |
141 // MockAttachmentStore being deleted on backend loop. | 141 // MockAttachmentStore being deleted on backend loop. |
142 attachment_store_handle_ = NULL; | 142 attachment_store_handle_ = NULL; |
143 EXPECT_EQ(dtor_call_count_, 0); | 143 EXPECT_EQ(dtor_call_count_, 0); |
144 RunMessageLoop(); | 144 RunMessageLoop(); |
145 EXPECT_EQ(dtor_call_count_, 1); | 145 EXPECT_EQ(dtor_call_count_, 1); |
146 } | 146 } |
147 | 147 |
148 } // namespace syncer | 148 } // namespace syncer |
OLD | NEW |