| 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_commit_contribution.h" | 5 #include "sync/engine/directory_commit_contribution.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "sync/internal_api/public/base/attachment_id_proto.h" | 8 #include "sync/internal_api/public/base/attachment_id_proto.h" |
| 9 #include "sync/sessions/status_controller.h" | 9 #include "sync/sessions/status_controller.h" |
| 10 #include "sync/syncable/entry.h" | 10 #include "sync/syncable/entry.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 const sync_pb::CommitMessage& commit_message = message.commit(); | 343 const sync_pb::CommitMessage& commit_message = message.commit(); |
| 344 pref_cc->CleanUp(); | 344 pref_cc->CleanUp(); |
| 345 | 345 |
| 346 ASSERT_EQ(1, commit_message.entries_size()); | 346 ASSERT_EQ(1, commit_message.entries_size()); |
| 347 EXPECT_FALSE(commit_message.entries(0).has_parent_id_string()); | 347 EXPECT_FALSE(commit_message.entries(0).has_parent_id_string()); |
| 348 EXPECT_TRUE(commit_message.entries(0).parent_id_string().empty()); | 348 EXPECT_TRUE(commit_message.entries(0).parent_id_string().empty()); |
| 349 } | 349 } |
| 350 | 350 |
| 351 void AddAttachment(sync_pb::AttachmentMetadata* metadata, bool is_on_server) { | 351 void AddAttachment(sync_pb::AttachmentMetadata* metadata, bool is_on_server) { |
| 352 sync_pb::AttachmentMetadataRecord record; | 352 sync_pb::AttachmentMetadataRecord record; |
| 353 *record.mutable_id() = CreateAttachmentIdProto(); | 353 *record.mutable_id() = CreateAttachmentIdProto(0, 0); |
| 354 record.set_is_on_server(is_on_server); | 354 record.set_is_on_server(is_on_server); |
| 355 *metadata->add_record() = record; | 355 *metadata->add_record() = record; |
| 356 } | 356 } |
| 357 | 357 |
| 358 // Creates some unsynced items, pretends to commit them, and hands back a | 358 // Creates some unsynced items, pretends to commit them, and hands back a |
| 359 // specially crafted response to the syncer in order to test commit response | 359 // specially crafted response to the syncer in order to test commit response |
| 360 // processing. The response simulates a succesful commit scenario. | 360 // processing. The response simulates a succesful commit scenario. |
| 361 TEST_F(DirectoryCommitContributionTest, ProcessCommitResponse) { | 361 TEST_F(DirectoryCommitContributionTest, ProcessCommitResponse) { |
| 362 int64 pref1_handle; | 362 int64 pref1_handle; |
| 363 int64 pref2_handle; | 363 int64 pref2_handle; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 syncable::Entry a3(&trans, syncable::GET_BY_HANDLE, art3_handle); | 493 syncable::Entry a3(&trans, syncable::GET_BY_HANDLE, art3_handle); |
| 494 EXPECT_FALSE(a3.GetId().ServerKnows()); | 494 EXPECT_FALSE(a3.GetId().ServerKnows()); |
| 495 EXPECT_FALSE(a3.GetSyncing()); | 495 EXPECT_FALSE(a3.GetSyncing()); |
| 496 EXPECT_EQ(0, a3.GetServerVersion()); | 496 EXPECT_EQ(0, a3.GetServerVersion()); |
| 497 } | 497 } |
| 498 | 498 |
| 499 art_cc->CleanUp(); | 499 art_cc->CleanUp(); |
| 500 } | 500 } |
| 501 | 501 |
| 502 } // namespace syncer | 502 } // namespace syncer |
| OLD | NEW |