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

Side by Side Diff: components/sync/device_info/device_info_sync_bridge_unittest.cc

Issue 2621373004: [Sync] Renamed OnMetadataLoaded to ModelReadyToSync. (Closed)
Patch Set: Rebase. Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/device_info/device_info_sync_bridge.h" 5 #include "components/sync/device_info/device_info_sync_bridge.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 std::unique_ptr<EntityData> entity_data, 183 std::unique_ptr<EntityData> entity_data,
184 MetadataChangeList* metadata_changes) override { 184 MetadataChangeList* metadata_changes) override {
185 put_multimap_.insert(std::make_pair(storage_key, std::move(entity_data))); 185 put_multimap_.insert(std::make_pair(storage_key, std::move(entity_data)));
186 } 186 }
187 187
188 void Delete(const std::string& storage_key, 188 void Delete(const std::string& storage_key,
189 MetadataChangeList* metadata_changes) override { 189 MetadataChangeList* metadata_changes) override {
190 delete_set_.insert(storage_key); 190 delete_set_.insert(storage_key);
191 } 191 }
192 192
193 void OnMetadataLoaded(std::unique_ptr<MetadataBatch> batch) override { 193 void ModelReadyToSync(std::unique_ptr<MetadataBatch> batch) override {
194 std::swap(metadata_, batch); 194 std::swap(metadata_, batch);
195 } 195 }
196 196
197 const std::multimap<std::string, std::unique_ptr<EntityData>>& put_multimap() 197 const std::multimap<std::string, std::unique_ptr<EntityData>>& put_multimap()
198 const { 198 const {
199 return put_multimap_; 199 return put_multimap_;
200 } 200 }
201 const std::set<std::string>& delete_set() const { return delete_set_; } 201 const std::set<std::string>& delete_set() const { return delete_set_; }
202 const MetadataBatch* metadata() const { return metadata_.get(); } 202 const MetadataBatch* metadata() const { return metadata_.get(); }
203 203
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 811
812 // Reloading from storage shouldn't contain remote data. 812 // Reloading from storage shouldn't contain remote data.
813 RestartBridge(); 813 RestartBridge();
814 EXPECT_EQ(1u, bridge()->GetAllDeviceInfo().size()); 814 EXPECT_EQ(1u, bridge()->GetAllDeviceInfo().size());
815 EXPECT_EQ(4, change_count()); 815 EXPECT_EQ(4, change_count());
816 } 816 }
817 817
818 } // namespace 818 } // namespace
819 819
820 } // namespace syncer 820 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/device_info/device_info_sync_bridge.cc ('k') | components/sync/model/fake_model_type_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698