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/model_type_worker.h" | 5 #include "sync/engine/model_type_worker.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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 ASSERT_TRUE(HasCommitResponseOnModelThread("tag1")); | 713 ASSERT_TRUE(HasCommitResponseOnModelThread("tag1")); |
714 const CommitResponseData& commit_response = | 714 const CommitResponseData& commit_response = |
715 GetCommitResponseOnModelThread("tag1"); | 715 GetCommitResponseOnModelThread("tag1"); |
716 | 716 |
717 // The ID changes in a commit response to initial commit. | 717 // The ID changes in a commit response to initial commit. |
718 EXPECT_FALSE(commit_response.id.empty()); | 718 EXPECT_FALSE(commit_response.id.empty()); |
719 EXPECT_NE(entity.id_string(), commit_response.id); | 719 EXPECT_NE(entity.id_string(), commit_response.id); |
720 | 720 |
721 EXPECT_EQ(client_tag_hash, commit_response.client_tag_hash); | 721 EXPECT_EQ(client_tag_hash, commit_response.client_tag_hash); |
722 EXPECT_LT(0, commit_response.response_version); | 722 EXPECT_LT(0, commit_response.response_version); |
| 723 EXPECT_LT(0, commit_response.sequence_number); |
| 724 EXPECT_FALSE(commit_response.specifics_hash.empty()); |
723 } | 725 } |
724 | 726 |
725 TEST_F(ModelTypeWorkerTest, SimpleDelete) { | 727 TEST_F(ModelTypeWorkerTest, SimpleDelete) { |
726 NormalInitialize(); | 728 NormalInitialize(); |
727 | 729 |
728 // We can't delete an entity that was never committed. | 730 // We can't delete an entity that was never committed. |
729 // Step 1 is to create and commit a new entity. | 731 // Step 1 is to create and commit a new entity. |
730 CommitRequest("tag1", "value1"); | 732 CommitRequest("tag1", "value1"); |
731 EXPECT_EQ(1, GetNumCommitNudges()); | 733 EXPECT_EQ(1, GetNumCommitNudges()); |
732 ASSERT_TRUE(WillCommit()); | 734 ASSERT_TRUE(WillCommit()); |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 // disconnected. | 1213 // disconnected. |
1212 TEST_F(ModelTypeWorkerTest, DisconnectProcessorFromSyncTest) { | 1214 TEST_F(ModelTypeWorkerTest, DisconnectProcessorFromSyncTest) { |
1213 // Initialize the worker with basic state. | 1215 // Initialize the worker with basic state. |
1214 NormalInitialize(); | 1216 NormalInitialize(); |
1215 EXPECT_FALSE(IsProcessorDisconnected()); | 1217 EXPECT_FALSE(IsProcessorDisconnected()); |
1216 ResetWorker(); | 1218 ResetWorker(); |
1217 EXPECT_TRUE(IsProcessorDisconnected()); | 1219 EXPECT_TRUE(IsProcessorDisconnected()); |
1218 } | 1220 } |
1219 | 1221 |
1220 } // namespace syncer_v2 | 1222 } // namespace syncer_v2 |
OLD | NEW |