Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Side by Side Diff: components/sync_driver/device_info_sync_service_unittest.cc

Issue 616983002: Reland Refactor FakeAttachmentStore (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Owned => Passed Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "components/sync_driver/device_info_sync_service.h" 6 #include "components/sync_driver/device_info_sync_service.h"
7 #include "components/sync_driver/local_device_info_provider_mock.h" 7 #include "components/sync_driver/local_device_info_provider_mock.h"
8 #include "sync/api/sync_change.h" 8 #include "sync/api/sync_change.h"
9 #include "sync/api/sync_change_processor.h" 9 #include "sync/api/sync_change_processor.h"
10 #include "sync/api/sync_change_processor_wrapper_for_test.h" 10 #include "sync/api/sync_change_processor_wrapper_for_test.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 SyncChange::SyncChangeType change_type, 146 SyncChange::SyncChangeType change_type,
147 const std::string& client_id, 147 const std::string& client_id,
148 const std::string& client_name) { 148 const std::string& client_name) {
149 SyncData sync_data = CreateRemoteData(client_id, client_name); 149 SyncData sync_data = CreateRemoteData(client_id, client_name);
150 SyncChange sync_change(FROM_HERE, change_type, sync_data); 150 SyncChange sync_change(FROM_HERE, change_type, sync_data);
151 change_list.push_back(sync_change); 151 change_list.push_back(sync_change);
152 } 152 }
153 153
154 protected: 154 protected:
155 int num_device_info_changed_callbacks_; 155 int num_device_info_changed_callbacks_;
156 base::MessageLoopForUI message_loop_;
156 scoped_ptr<LocalDeviceInfoProviderMock> local_device_; 157 scoped_ptr<LocalDeviceInfoProviderMock> local_device_;
157 scoped_ptr<DeviceInfoSyncService> sync_service_; 158 scoped_ptr<DeviceInfoSyncService> sync_service_;
158 scoped_ptr<TestChangeProcessor> sync_processor_; 159 scoped_ptr<TestChangeProcessor> sync_processor_;
159 base::MessageLoopForUI message_loop_;
160 }; 160 };
161 161
162 // Sync with empty initial data. 162 // Sync with empty initial data.
163 TEST_F(DeviceInfoSyncServiceTest, StartSyncEmptyInitialData) { 163 TEST_F(DeviceInfoSyncServiceTest, StartSyncEmptyInitialData) {
164 SyncMergeResult merge_result = 164 SyncMergeResult merge_result =
165 sync_service_->MergeDataAndStartSyncing(syncer::DEVICE_INFO, 165 sync_service_->MergeDataAndStartSyncing(syncer::DEVICE_INFO,
166 SyncDataList(), 166 SyncDataList(),
167 PassProcessor(), 167 PassProcessor(),
168 CreateAndPassSyncErrorFactory()); 168 CreateAndPassSyncErrorFactory());
169 169
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 EXPECT_EQ("client_1", sync_processor_->client_name_at(0)); 547 EXPECT_EQ("client_1", sync_processor_->client_name_at(0));
548 548
549 backup_time = syncer::ProtoTimeToTime( 549 backup_time = syncer::ProtoTimeToTime(
550 sync_processor_->device_info_at(0).backup_timestamp()); 550 sync_processor_->device_info_at(0).backup_timestamp());
551 EXPECT_EQ(6000, backup_time.ToTimeT()); 551 EXPECT_EQ(6000, backup_time.ToTimeT());
552 } 552 }
553 553
554 } // namespace 554 } // namespace
555 555
556 } // namespace sync_driver 556 } // namespace sync_driver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698