| 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/generic_change_processor.h" | 5 #include "components/sync_driver/generic_change_processor.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "components/sync_driver/data_type_error_handler_mock.h" | 11 #include "components/sync_driver/data_type_error_handler_mock.h" |
| 12 #include "components/sync_driver/sync_api_component_factory.h" | 12 #include "components/sync_driver/sync_api_component_factory.h" |
| 13 #include "sync/api/attachments/attachment_service_impl.h" | 13 #include "sync/api/attachments/attachment_service_impl.h" |
| 14 #include "sync/api/fake_syncable_service.h" | 14 #include "sync/api/fake_syncable_service.h" |
| 15 #include "sync/api/sync_change.h" | 15 #include "sync/api/sync_change.h" |
| 16 #include "sync/api/sync_merge_result.h" | 16 #include "sync/api/sync_merge_result.h" |
| 17 #include "sync/internal_api/public/attachments/fake_attachment_downloader.h" |
| 17 #include "sync/internal_api/public/attachments/fake_attachment_store.h" | 18 #include "sync/internal_api/public/attachments/fake_attachment_store.h" |
| 18 #include "sync/internal_api/public/attachments/fake_attachment_uploader.h" | 19 #include "sync/internal_api/public/attachments/fake_attachment_uploader.h" |
| 19 #include "sync/internal_api/public/base/model_type.h" | 20 #include "sync/internal_api/public/base/model_type.h" |
| 20 #include "sync/internal_api/public/read_node.h" | 21 #include "sync/internal_api/public/read_node.h" |
| 21 #include "sync/internal_api/public/read_transaction.h" | 22 #include "sync/internal_api/public/read_transaction.h" |
| 22 #include "sync/internal_api/public/sync_encryption_handler.h" | 23 #include "sync/internal_api/public/sync_encryption_handler.h" |
| 23 #include "sync/internal_api/public/test/test_user_share.h" | 24 #include "sync/internal_api/public/test/test_user_share.h" |
| 24 #include "sync/internal_api/public/user_share.h" | 25 #include "sync/internal_api/public/user_share.h" |
| 25 #include "sync/internal_api/public/write_node.h" | 26 #include "sync/internal_api/public/write_node.h" |
| 26 #include "sync/internal_api/public/write_transaction.h" | 27 #include "sync/internal_api/public/write_transaction.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 44 private: | 45 private: |
| 45 std::vector<syncer::AttachmentList> attachment_lists_; | 46 std::vector<syncer::AttachmentList> attachment_lists_; |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 MockAttachmentService::MockAttachmentService() | 49 MockAttachmentService::MockAttachmentService() |
| 49 : AttachmentServiceImpl( | 50 : AttachmentServiceImpl( |
| 50 scoped_ptr<syncer::AttachmentStore>(new syncer::FakeAttachmentStore( | 51 scoped_ptr<syncer::AttachmentStore>(new syncer::FakeAttachmentStore( |
| 51 base::MessageLoopProxy::current())), | 52 base::MessageLoopProxy::current())), |
| 52 scoped_ptr<syncer::AttachmentUploader>( | 53 scoped_ptr<syncer::AttachmentUploader>( |
| 53 new syncer::FakeAttachmentUploader), | 54 new syncer::FakeAttachmentUploader), |
| 55 scoped_ptr<syncer::AttachmentDownloader>( |
| 56 new syncer::FakeAttachmentDownloader), |
| 54 NULL) { | 57 NULL) { |
| 55 } | 58 } |
| 56 | 59 |
| 57 MockAttachmentService::~MockAttachmentService() { | 60 MockAttachmentService::~MockAttachmentService() { |
| 58 } | 61 } |
| 59 | 62 |
| 60 void MockAttachmentService::StoreAttachments( | 63 void MockAttachmentService::StoreAttachments( |
| 61 const syncer::AttachmentList& attachments, | 64 const syncer::AttachmentList& attachments, |
| 62 const StoreCallback& callback) { | 65 const StoreCallback& callback) { |
| 63 attachment_lists_.push_back(attachments); | 66 attachment_lists_.push_back(attachments); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 syncer::ReadNode node(&read_transaction); | 413 syncer::ReadNode node(&read_transaction); |
| 411 ASSERT_EQ(node.InitByClientTagLookup(syncer::PREFERENCES, tag), | 414 ASSERT_EQ(node.InitByClientTagLookup(syncer::PREFERENCES, tag), |
| 412 syncer::BaseNode::INIT_OK); | 415 syncer::BaseNode::INIT_OK); |
| 413 syncer::AttachmentIdList attachment_ids = node.GetAttachmentIds(); | 416 syncer::AttachmentIdList attachment_ids = node.GetAttachmentIds(); |
| 414 EXPECT_EQ(1U, attachment_ids.size()); | 417 EXPECT_EQ(1U, attachment_ids.size()); |
| 415 } | 418 } |
| 416 | 419 |
| 417 } // namespace | 420 } // namespace |
| 418 | 421 |
| 419 } // namespace browser_sync | 422 } // namespace browser_sync |
| OLD | NEW |