| 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 #include <string> | 8 #include <string> | 
| 9 | 9 | 
| 10 #include "base/bind.h" | 10 #include "base/bind.h" | 
| 11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" | 
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" | 
| 13 #include "base/location.h" | 13 #include "base/location.h" | 
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" | 
| 15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" | 
| 16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" | 
| 17 #include "components/sync/api/attachments/attachment_id.h" | 17 #include "components/sync/api/attachments/attachment_id.h" | 
| 18 #include "components/sync/api/attachments/attachment_store.h" | 18 #include "components/sync/api/attachments/attachment_store.h" | 
| 19 #include "components/sync/api/fake_syncable_service.h" | 19 #include "components/sync/api/fake_syncable_service.h" | 
| 20 #include "components/sync/base/model_type.h" | 20 #include "components/sync/base/model_type.h" | 
| 21 #include "components/sync/core/attachments/attachment_service_impl.h" | 21 #include "components/sync/core/attachments/attachment_service_impl.h" | 
| 22 #include "components/sync/core/test/data_type_error_handler_mock.h" | 22 #include "components/sync/core/test/data_type_error_handler_mock.h" | 
| 23 #include "components/sync/core/test/test_user_share.h" | 23 #include "components/sync/core/test/test_user_share.h" | 
| 24 #include "components/sync_driver/fake_sync_client.h" | 24 #include "components/sync/driver/fake_sync_client.h" | 
| 25 #include "components/sync_driver/generic_change_processor.h" | 25 #include "components/sync/driver/generic_change_processor.h" | 
| 26 #include "components/sync_driver/generic_change_processor_factory.h" | 26 #include "components/sync/driver/generic_change_processor_factory.h" | 
| 27 #include "components/sync_driver/local_device_info_provider.h" | 27 #include "components/sync/driver/local_device_info_provider.h" | 
| 28 #include "components/sync_driver/sync_api_component_factory.h" | 28 #include "components/sync/driver/sync_api_component_factory.h" | 
| 29 #include "testing/gmock/include/gmock/gmock.h" | 29 #include "testing/gmock/include/gmock/gmock.h" | 
| 30 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" | 
| 31 | 31 | 
| 32 namespace sync_driver { | 32 namespace sync_driver { | 
| 33 | 33 | 
| 34 namespace { | 34 namespace { | 
| 35 | 35 | 
| 36 using ::testing::NiceMock; | 36 using ::testing::NiceMock; | 
| 37 using ::testing::StrictMock; | 37 using ::testing::StrictMock; | 
| 38 | 38 | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 73   std::unique_ptr<syncer::AttachmentService> CreateAttachmentService( | 73   std::unique_ptr<syncer::AttachmentService> CreateAttachmentService( | 
| 74       std::unique_ptr<syncer::AttachmentStoreForSync> attachment_store, | 74       std::unique_ptr<syncer::AttachmentStoreForSync> attachment_store, | 
| 75       const syncer::UserShare& user_share, | 75       const syncer::UserShare& user_share, | 
| 76       const std::string& store_birthday, | 76       const std::string& store_birthday, | 
| 77       syncer::ModelType model_type, | 77       syncer::ModelType model_type, | 
| 78       syncer::AttachmentService::Delegate* delegate) override { | 78       syncer::AttachmentService::Delegate* delegate) override { | 
| 79     return syncer::AttachmentServiceImpl::CreateForTest(); | 79     return syncer::AttachmentServiceImpl::CreateForTest(); | 
| 80   } | 80   } | 
| 81 }; | 81 }; | 
| 82 | 82 | 
| 83 class SyncSharedChangeProcessorTest : | 83 class SyncSharedChangeProcessorTest : public testing::Test, | 
| 84     public testing::Test, | 84                                       public FakeSyncClient { | 
| 85     public FakeSyncClient { |  | 
| 86  public: | 85  public: | 
| 87   SyncSharedChangeProcessorTest() | 86   SyncSharedChangeProcessorTest() | 
| 88       : FakeSyncClient(&factory_), | 87       : FakeSyncClient(&factory_), | 
| 89         backend_thread_("dbthread"), | 88         backend_thread_("dbthread"), | 
| 90         did_connect_(false), | 89         did_connect_(false), | 
| 91         has_attachment_service_(false) {} | 90         has_attachment_service_(false) {} | 
| 92 | 91 | 
| 93   ~SyncSharedChangeProcessorTest() override { | 92   ~SyncSharedChangeProcessorTest() override { | 
| 94     EXPECT_FALSE(db_syncable_service_.get()); | 93     EXPECT_FALSE(db_syncable_service_.get()); | 
| 95   } | 94   } | 
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 229 // creates AttachmentService and passes it back to the syncable service. | 228 // creates AttachmentService and passes it back to the syncable service. | 
| 230 TEST_F(SyncSharedChangeProcessorTest, ConnectWithAttachmentStore) { | 229 TEST_F(SyncSharedChangeProcessorTest, ConnectWithAttachmentStore) { | 
| 231   SetAttachmentStore(); | 230   SetAttachmentStore(); | 
| 232   Connect(); | 231   Connect(); | 
| 233   EXPECT_TRUE(HasAttachmentService()); | 232   EXPECT_TRUE(HasAttachmentService()); | 
| 234 } | 233 } | 
| 235 | 234 | 
| 236 }  // namespace | 235 }  // namespace | 
| 237 | 236 | 
| 238 }  // namespace sync_driver | 237 }  // namespace sync_driver | 
| OLD | NEW | 
|---|