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 "sync/engine/directory_update_handler.h" | 5 #include "sync/engine/directory_update_handler.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 const std::string& id, | 110 const std::string& id, |
111 const std::string& parent, | 111 const std::string& parent, |
112 const ModelType& type) { | 112 const ModelType& type) { |
113 scoped_ptr<sync_pb::SyncEntity> e(new sync_pb::SyncEntity()); | 113 scoped_ptr<sync_pb::SyncEntity> e(new sync_pb::SyncEntity()); |
114 e->set_id_string(id); | 114 e->set_id_string(id); |
115 e->set_parent_id_string(parent); | 115 e->set_parent_id_string(parent); |
116 e->set_non_unique_name(id); | 116 e->set_non_unique_name(id); |
117 e->set_name(id); | 117 e->set_name(id); |
118 e->set_version(kDefaultVersion); | 118 e->set_version(kDefaultVersion); |
119 AddDefaultFieldValue(type, e->mutable_specifics()); | 119 AddDefaultFieldValue(type, e->mutable_specifics()); |
120 return e.Pass(); | 120 return e; |
121 } | 121 } |
122 | 122 |
123 void DirectoryUpdateHandlerProcessUpdateTest::UpdateSyncEntities( | 123 void DirectoryUpdateHandlerProcessUpdateTest::UpdateSyncEntities( |
124 DirectoryUpdateHandler* handler, | 124 DirectoryUpdateHandler* handler, |
125 const SyncEntityList& applicable_updates, | 125 const SyncEntityList& applicable_updates, |
126 sessions::StatusController* status) { | 126 sessions::StatusController* status) { |
127 syncable::ModelNeutralWriteTransaction trans(FROM_HERE, UNITTEST, dir()); | 127 syncable::ModelNeutralWriteTransaction trans(FROM_HERE, UNITTEST, dir()); |
128 handler->UpdateSyncEntities(&trans, applicable_updates, status); | 128 handler->UpdateSyncEntities(&trans, applicable_updates, status); |
129 } | 129 } |
130 | 130 |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 const UpdateCounters& counters = GetArticlesUpdateCounters(); | 1150 const UpdateCounters& counters = GetArticlesUpdateCounters(); |
1151 EXPECT_EQ(1, counters.num_updates_applied); | 1151 EXPECT_EQ(1, counters.num_updates_applied); |
1152 EXPECT_EQ(1, counters.num_local_overwrites); | 1152 EXPECT_EQ(1, counters.num_local_overwrites); |
1153 EXPECT_EQ(0, counters.num_server_overwrites); | 1153 EXPECT_EQ(0, counters.num_server_overwrites); |
1154 local_metadata = entry_factory()->GetLocalAttachmentMetadataForItem(handle); | 1154 local_metadata = entry_factory()->GetLocalAttachmentMetadataForItem(handle); |
1155 EXPECT_EQ(server_metadata.SerializeAsString(), | 1155 EXPECT_EQ(server_metadata.SerializeAsString(), |
1156 local_metadata.SerializeAsString()); | 1156 local_metadata.SerializeAsString()); |
1157 } | 1157 } |
1158 | 1158 |
1159 } // namespace syncer | 1159 } // namespace syncer |
OLD | NEW |