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

Side by Side Diff: components/sync/model_impl/shared_model_type_processor_unittest.cc

Issue 2422253002: [Sync] Rewriting ".reset(new" pattern to use "= base::MakeUnique" instead. (Closed)
Patch Set: Fixing compile. Created 4 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 "components/sync/model_impl/shared_model_type_processor.h" 5 #include "components/sync/model_impl/shared_model_type_processor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 const EntityData& out_entity1 = 667 const EntityData& out_entity1 =
668 worker()->GetLatestPendingCommitForHash(kHash1).entity.value(); 668 worker()->GetLatestPendingCommitForHash(kHash1).entity.value();
669 const EntityMetadata metadata_v1 = db().GetMetadata(kKey1); 669 const EntityMetadata metadata_v1 = db().GetMetadata(kKey1);
670 670
671 EXPECT_EQ(kId1, out_entity1.id); 671 EXPECT_EQ(kId1, out_entity1.id);
672 EXPECT_NE(kHash3, out_entity1.client_tag_hash); 672 EXPECT_NE(kHash3, out_entity1.client_tag_hash);
673 EXPECT_EQ(kValue1, out_entity1.specifics.preference().value()); 673 EXPECT_EQ(kValue1, out_entity1.specifics.preference().value());
674 EXPECT_EQ(kId1, metadata_v1.server_id()); 674 EXPECT_EQ(kId1, metadata_v1.server_id());
675 EXPECT_EQ(metadata_v1.client_tag_hash(), out_entity1.client_tag_hash); 675 EXPECT_EQ(metadata_v1.client_tag_hash(), out_entity1.client_tag_hash);
676 676
677 entity_data.reset(new EntityData()); 677 entity_data = base::MakeUnique<EntityData>();
678 // This is a sketchy move here, changing the name will change the generated 678 // This is a sketchy move here, changing the name will change the generated
679 // storage key and client tag values. 679 // storage key and client tag values.
680 entity_data->specifics.mutable_preference()->set_name(kKey2); 680 entity_data->specifics.mutable_preference()->set_name(kKey2);
681 entity_data->specifics.mutable_preference()->set_value(kValue2); 681 entity_data->specifics.mutable_preference()->set_value(kValue2);
682 entity_data->non_unique_name = kKey2; 682 entity_data->non_unique_name = kKey2;
683 entity_data->client_tag_hash = kHash3; 683 entity_data->client_tag_hash = kHash3;
684 // Make sure ID isn't overwritten either. 684 // Make sure ID isn't overwritten either.
685 entity_data->id = kId2; 685 entity_data->id = kId2;
686 service()->WriteItem(kKey1, std::move(entity_data)); 686 service()->WriteItem(kKey1, std::move(entity_data));
687 687
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 1299
1300 UpdateResponseDataList update; 1300 UpdateResponseDataList update;
1301 update.push_back(worker()->GenerateUpdateData(kHash1, specifics1, 1, "k1")); 1301 update.push_back(worker()->GenerateUpdateData(kHash1, specifics1, 1, "k1"));
1302 worker()->UpdateWithEncryptionKey("k1", update); 1302 worker()->UpdateWithEncryptionKey("k1", update);
1303 1303
1304 EXPECT_EQ(2U, worker()->GetNumPendingCommits()); 1304 EXPECT_EQ(2U, worker()->GetNumPendingCommits());
1305 worker()->ExpectNthPendingCommit(1, kHash1, specifics2); 1305 worker()->ExpectNthPendingCommit(1, kHash1, specifics2);
1306 } 1306 }
1307 1307
1308 } // namespace syncer 1308 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/model_impl/model_type_store_impl.cc ('k') | components/sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698