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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 protected: | 81 protected: |
82 AttachmentStoreHandleTest() | 82 AttachmentStoreHandleTest() |
83 : init_call_count_(0), | 83 : init_call_count_(0), |
84 read_call_count_(0), | 84 read_call_count_(0), |
85 write_call_count_(0), | 85 write_call_count_(0), |
86 drop_call_count_(0), | 86 drop_call_count_(0), |
87 read_metadata_call_count_(0), | 87 read_metadata_call_count_(0), |
88 read_all_metadata_call_count_(0), | 88 read_all_metadata_call_count_(0), |
89 dtor_call_count_(0) {} | 89 dtor_call_count_(0) {} |
90 | 90 |
91 virtual void SetUp() { | 91 void SetUp() override { |
92 scoped_ptr<AttachmentStoreBase> backend(new MockAttachmentStore( | 92 scoped_ptr<AttachmentStoreBase> backend(new MockAttachmentStore( |
93 base::Bind(&AttachmentStoreHandleTest::InitCalled, | 93 base::Bind(&AttachmentStoreHandleTest::InitCalled, |
94 base::Unretained(this)), | 94 base::Unretained(this)), |
95 base::Bind(&AttachmentStoreHandleTest::ReadCalled, | 95 base::Bind(&AttachmentStoreHandleTest::ReadCalled, |
96 base::Unretained(this)), | 96 base::Unretained(this)), |
97 base::Bind(&AttachmentStoreHandleTest::WriteCalled, | 97 base::Bind(&AttachmentStoreHandleTest::WriteCalled, |
98 base::Unretained(this)), | 98 base::Unretained(this)), |
99 base::Bind(&AttachmentStoreHandleTest::DropCalled, | 99 base::Bind(&AttachmentStoreHandleTest::DropCalled, |
100 base::Unretained(this)), | 100 base::Unretained(this)), |
101 base::Bind(&AttachmentStoreHandleTest::ReadMetadataCalled, | 101 base::Bind(&AttachmentStoreHandleTest::ReadMetadataCalled, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 // Releasing referehce to AttachmentStoreHandle should result in | 197 // Releasing referehce to AttachmentStoreHandle should result in |
198 // MockAttachmentStore being deleted on backend loop. | 198 // MockAttachmentStore being deleted on backend loop. |
199 attachment_store_handle_ = NULL; | 199 attachment_store_handle_ = NULL; |
200 EXPECT_EQ(dtor_call_count_, 0); | 200 EXPECT_EQ(dtor_call_count_, 0); |
201 RunMessageLoop(); | 201 RunMessageLoop(); |
202 EXPECT_EQ(dtor_call_count_, 1); | 202 EXPECT_EQ(dtor_call_count_, 1); |
203 } | 203 } |
204 | 204 |
205 } // namespace syncer | 205 } // namespace syncer |
OLD | NEW |