| 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/device_info_sync_service.h" | 5 #include "components/sync_driver/device_info_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 #include <stdint.h> |
| 9 |
| 7 #include <string> | 10 #include <string> |
| 8 | 11 |
| 9 #include "components/sync_driver/local_device_info_provider_mock.h" | 12 #include "components/sync_driver/local_device_info_provider_mock.h" |
| 10 #include "sync/api/sync_change.h" | 13 #include "sync/api/sync_change.h" |
| 11 #include "sync/api/sync_change_processor.h" | 14 #include "sync/api/sync_change_processor.h" |
| 12 #include "sync/api/sync_change_processor_wrapper_for_test.h" | 15 #include "sync/api/sync_change_processor_wrapper_for_test.h" |
| 13 #include "sync/api/sync_error_factory_mock.h" | 16 #include "sync/api/sync_error_factory_mock.h" |
| 14 #include "sync/internal_api/public/attachments/attachment_service_proxy_for_test
.h" | 17 #include "sync/internal_api/public/attachments/attachment_service_proxy_for_test
.h" |
| 15 #include "sync/util/time.h" | 18 #include "sync/util/time.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 return scoped_ptr<SyncChangeProcessor>( | 106 return scoped_ptr<SyncChangeProcessor>( |
| 104 new SyncChangeProcessorWrapperForTest(sync_processor_.get())); | 107 new SyncChangeProcessorWrapperForTest(sync_processor_.get())); |
| 105 } | 108 } |
| 106 | 109 |
| 107 scoped_ptr<SyncErrorFactory> CreateAndPassSyncErrorFactory() { | 110 scoped_ptr<SyncErrorFactory> CreateAndPassSyncErrorFactory() { |
| 108 return scoped_ptr<SyncErrorFactory>(new SyncErrorFactoryMock()); | 111 return scoped_ptr<SyncErrorFactory>(new SyncErrorFactoryMock()); |
| 109 } | 112 } |
| 110 | 113 |
| 111 SyncData CreateRemoteData(const std::string& client_id, | 114 SyncData CreateRemoteData(const std::string& client_id, |
| 112 const std::string& client_name, | 115 const std::string& client_name, |
| 113 int64 backup_timestamp = 0) { | 116 int64_t backup_timestamp = 0) { |
| 114 sync_pb::EntitySpecifics entity; | 117 sync_pb::EntitySpecifics entity; |
| 115 sync_pb::DeviceInfoSpecifics& specifics = *entity.mutable_device_info(); | 118 sync_pb::DeviceInfoSpecifics& specifics = *entity.mutable_device_info(); |
| 116 | 119 |
| 117 specifics.set_cache_guid(client_id); | 120 specifics.set_cache_guid(client_id); |
| 118 specifics.set_client_name(client_name); | 121 specifics.set_client_name(client_name); |
| 119 specifics.set_chrome_version("Chromium 10k"); | 122 specifics.set_chrome_version("Chromium 10k"); |
| 120 specifics.set_sync_user_agent("Chrome 10k"); | 123 specifics.set_sync_user_agent("Chrome 10k"); |
| 121 specifics.set_device_type(sync_pb::SyncEnums_DeviceType_TYPE_LINUX); | 124 specifics.set_device_type(sync_pb::SyncEnums_DeviceType_TYPE_LINUX); |
| 122 specifics.set_signin_scoped_device_id("device_id"); | 125 specifics.set_signin_scoped_device_id("device_id"); |
| 123 | 126 |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 EXPECT_EQ("client_1", sync_processor_->client_name_at(0)); | 560 EXPECT_EQ("client_1", sync_processor_->client_name_at(0)); |
| 558 | 561 |
| 559 backup_time = syncer::ProtoTimeToTime( | 562 backup_time = syncer::ProtoTimeToTime( |
| 560 sync_processor_->device_info_at(0).backup_timestamp()); | 563 sync_processor_->device_info_at(0).backup_timestamp()); |
| 561 EXPECT_EQ(6000, backup_time.ToTimeT()); | 564 EXPECT_EQ(6000, backup_time.ToTimeT()); |
| 562 } | 565 } |
| 563 | 566 |
| 564 } // namespace | 567 } // namespace |
| 565 | 568 |
| 566 } // namespace sync_driver | 569 } // namespace sync_driver |
| OLD | NEW |