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/driver/shared_change_processor.h" | 5 #include "components/sync/driver/shared_change_processor.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
14 #include "components/sync/api/attachments/attachment_id.h" | 14 #include "components/sync/api/attachments/attachment_id.h" |
| 15 #include "components/sync/api/attachments/attachment_service.h" |
15 #include "components/sync/api/attachments/attachment_store.h" | 16 #include "components/sync/api/attachments/attachment_store.h" |
16 #include "components/sync/api/data_type_error_handler_mock.h" | 17 #include "components/sync/api/data_type_error_handler_mock.h" |
17 #include "components/sync/api/fake_syncable_service.h" | 18 #include "components/sync/api/fake_syncable_service.h" |
18 #include "components/sync/base/model_type.h" | 19 #include "components/sync/base/model_type.h" |
19 #include "components/sync/core/attachments/attachment_service_impl.h" | |
20 #include "components/sync/core/test/test_user_share.h" | 20 #include "components/sync/core/test/test_user_share.h" |
21 #include "components/sync/device_info/local_device_info_provider.h" | 21 #include "components/sync/device_info/local_device_info_provider.h" |
22 #include "components/sync/driver/fake_sync_client.h" | 22 #include "components/sync/driver/fake_sync_client.h" |
23 #include "components/sync/driver/generic_change_processor.h" | 23 #include "components/sync/driver/generic_change_processor.h" |
24 #include "components/sync/driver/generic_change_processor_factory.h" | 24 #include "components/sync/driver/generic_change_processor_factory.h" |
25 #include "components/sync/driver/sync_api_component_factory.h" | 25 #include "components/sync/driver/sync_api_component_factory.h" |
26 #include "testing/gmock/include/gmock/gmock.h" | 26 #include "testing/gmock/include/gmock/gmock.h" |
27 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
28 | 28 |
29 namespace syncer { | 29 namespace syncer { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 SyncService* sync_service, | 65 SyncService* sync_service, |
66 std::unique_ptr<DataTypeErrorHandler> error_handler) override { | 66 std::unique_ptr<DataTypeErrorHandler> error_handler) override { |
67 return SyncApiComponentFactory::SyncComponents(nullptr, nullptr); | 67 return SyncApiComponentFactory::SyncComponents(nullptr, nullptr); |
68 } | 68 } |
69 std::unique_ptr<AttachmentService> CreateAttachmentService( | 69 std::unique_ptr<AttachmentService> CreateAttachmentService( |
70 std::unique_ptr<AttachmentStoreForSync> attachment_store, | 70 std::unique_ptr<AttachmentStoreForSync> attachment_store, |
71 const UserShare& user_share, | 71 const UserShare& user_share, |
72 const std::string& store_birthday, | 72 const std::string& store_birthday, |
73 ModelType model_type, | 73 ModelType model_type, |
74 AttachmentService::Delegate* delegate) override { | 74 AttachmentService::Delegate* delegate) override { |
75 return AttachmentServiceImpl::CreateForTest(); | 75 return AttachmentService::CreateForTest(); |
76 } | 76 } |
77 }; | 77 }; |
78 | 78 |
79 class SyncSharedChangeProcessorTest : public testing::Test, | 79 class SyncSharedChangeProcessorTest : public testing::Test, |
80 public FakeSyncClient { | 80 public FakeSyncClient { |
81 public: | 81 public: |
82 SyncSharedChangeProcessorTest() | 82 SyncSharedChangeProcessorTest() |
83 : FakeSyncClient(&factory_), | 83 : FakeSyncClient(&factory_), |
84 backend_thread_("dbthread"), | 84 backend_thread_("dbthread"), |
85 did_connect_(false), | 85 did_connect_(false), |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // creates AttachmentService and passes it back to the syncable service. | 223 // creates AttachmentService and passes it back to the syncable service. |
224 TEST_F(SyncSharedChangeProcessorTest, ConnectWithAttachmentStore) { | 224 TEST_F(SyncSharedChangeProcessorTest, ConnectWithAttachmentStore) { |
225 SetAttachmentStore(); | 225 SetAttachmentStore(); |
226 Connect(); | 226 Connect(); |
227 EXPECT_TRUE(HasAttachmentService()); | 227 EXPECT_TRUE(HasAttachmentService()); |
228 } | 228 } |
229 | 229 |
230 } // namespace | 230 } // namespace |
231 | 231 |
232 } // namespace syncer | 232 } // namespace syncer |
OLD | NEW |