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_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_ | 5 #ifndef SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_ |
6 #define SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_ | 6 #define SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_ |
7 | 7 |
8 #include "sync/api/attachments/attachment_store.h" | 8 #include "sync/api/attachments/attachment_store.h" |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
12 #include "base/memory/ref_counted_memory.h" | 12 #include "base/memory/ref_counted_memory.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/run_loop.h" |
15 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
16 #include "sync/api/attachments/attachment.h" | 16 #include "sync/api/attachments/attachment.h" |
17 #include "sync/internal_api/public/attachments/attachment_util.h" | 17 #include "sync/internal_api/public/attachments/attachment_util.h" |
18 #include "sync/protocol/sync.pb.h" | 18 #include "sync/protocol/sync.pb.h" |
19 #include "testing/gmock/include/gmock/gmock-matchers.h" | 19 #include "testing/gmock/include/gmock/gmock-matchers.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
22 // AttachmentStoreTest defines tests for AttachmentStore. To instantiate these | 22 // AttachmentStoreTest defines tests for AttachmentStore. To instantiate these |
23 // tests for a particular implementation you need to: | 23 // tests for a particular implementation you need to: |
24 // - Include this file in test. | 24 // - Include this file in test. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 some_data1 = new base::RefCountedString; | 82 some_data1 = new base::RefCountedString; |
83 some_data1->data() = kTestData1; | 83 some_data1->data() = kTestData1; |
84 | 84 |
85 some_data2 = new base::RefCountedString; | 85 some_data2 = new base::RefCountedString; |
86 some_data2->data() = kTestData2; | 86 some_data2->data() = kTestData2; |
87 } | 87 } |
88 | 88 |
89 void ClearAndPumpLoop() { | 89 void ClearAndPumpLoop() { |
90 Clear(); | 90 Clear(); |
91 message_loop.RunUntilIdle(); | 91 base::RunLoop().RunUntilIdle(); |
92 } | 92 } |
93 | 93 |
94 private: | 94 private: |
95 void Clear() { | 95 void Clear() { |
96 result = AttachmentStore::UNSPECIFIED_ERROR; | 96 result = AttachmentStore::UNSPECIFIED_ERROR; |
97 attachments.reset(); | 97 attachments.reset(); |
98 failed_attachment_ids.reset(); | 98 failed_attachment_ids.reset(); |
99 attachment_metadata.reset(); | 99 attachment_metadata.reset(); |
100 } | 100 } |
101 | 101 |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 Write_RoundTrip, | 391 Write_RoundTrip, |
392 Read_OneNotFound, | 392 Read_OneNotFound, |
393 Drop_DropTwoButOnlyOneExists, | 393 Drop_DropTwoButOnlyOneExists, |
394 Drop_DoesNotExist, | 394 Drop_DoesNotExist, |
395 ReadMetadata, | 395 ReadMetadata, |
396 ReadAllMetadata); | 396 ReadAllMetadata); |
397 | 397 |
398 } // namespace syncer | 398 } // namespace syncer |
399 | 399 |
400 #endif // SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_ | 400 #endif // SYNC_INTERNAL_API_ATTACHMENTS_ATTACHMENT_STORE_TEST_TEMPLATE_H_ |
OLD | NEW |