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 "components/sync/api/sync_data.h" | 5 #include "components/sync/api/sync_data.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
12 #include "components/sync/core/attachments/attachment_service.h" | 12 #include "components/sync/api/attachments/attachment_service.h" |
13 #include "components/sync/core/attachments/attachment_service_impl.h" | |
14 #include "components/sync/protocol/sync.pb.h" | 13 #include "components/sync/protocol/sync.pb.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
16 | 15 |
17 using std::string; | 16 using std::string; |
18 | 17 |
19 namespace syncer { | 18 namespace syncer { |
20 | 19 |
21 namespace { | 20 namespace { |
22 | 21 |
23 const char kSyncTag[] = "3984729834"; | 22 const char kSyncTag[] = "3984729834"; |
24 const ModelType kDatatype = PREFERENCES; | 23 const ModelType kDatatype = PREFERENCES; |
25 const char kNonUniqueTitle[] = "my preference"; | 24 const char kNonUniqueTitle[] = "my preference"; |
26 const int64_t kId = 439829; | 25 const int64_t kId = 439829; |
27 const base::Time kLastModifiedTime = base::Time(); | 26 const base::Time kLastModifiedTime = base::Time(); |
28 | 27 |
29 class SyncDataTest : public testing::Test { | 28 class SyncDataTest : public testing::Test { |
30 protected: | 29 protected: |
31 SyncDataTest() | 30 SyncDataTest() |
32 : attachment_service(AttachmentServiceImpl::CreateForTest()), | 31 : attachment_service(AttachmentService::CreateForTest()), |
33 attachment_service_weak_ptr_factory(attachment_service.get()), | 32 attachment_service_weak_ptr_factory(attachment_service.get()), |
34 attachment_service_proxy( | 33 attachment_service_proxy( |
35 base::ThreadTaskRunnerHandle::Get(), | 34 base::ThreadTaskRunnerHandle::Get(), |
36 attachment_service_weak_ptr_factory.GetWeakPtr()) {} | 35 attachment_service_weak_ptr_factory.GetWeakPtr()) {} |
37 base::MessageLoop loop; | 36 base::MessageLoop loop; |
38 sync_pb::EntitySpecifics specifics; | 37 sync_pb::EntitySpecifics specifics; |
39 std::unique_ptr<AttachmentService> attachment_service; | 38 std::unique_ptr<AttachmentService> attachment_service; |
40 base::WeakPtrFactory<AttachmentService> attachment_service_weak_ptr_factory; | 39 base::WeakPtrFactory<AttachmentService> attachment_service_weak_ptr_factory; |
41 AttachmentServiceProxy attachment_service_proxy; | 40 AttachmentServiceProxy attachment_service_proxy; |
42 }; | 41 }; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 EXPECT_TRUE(data.GetSpecifics().has_preference()); | 110 EXPECT_TRUE(data.GetSpecifics().has_preference()); |
112 EXPECT_TRUE(data.GetAttachmentIds().empty()); | 111 EXPECT_TRUE(data.GetAttachmentIds().empty()); |
113 } | 112 } |
114 | 113 |
115 // TODO(maniscalco): Add test cases that verify GetLocalAttachmentsForUpload | 114 // TODO(maniscalco): Add test cases that verify GetLocalAttachmentsForUpload |
116 // calls are passed through to the underlying AttachmentService. | 115 // calls are passed through to the underlying AttachmentService. |
117 | 116 |
118 } // namespace | 117 } // namespace |
119 | 118 |
120 } // namespace syncer | 119 } // namespace syncer |
OLD | NEW |