| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 // Unit tests for the SyncApi. Note that a lot of the underlying | 5 // Unit tests for the SyncApi. Note that a lot of the underlying |
| 6 // functionality is provided by the Syncable layer, which has its own | 6 // functionality is provided by the Syncable layer, which has its own |
| 7 // unit tests. We'll test SyncApi specific things in this harness. | 7 // unit tests. We'll test SyncApi specific things in this harness. |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 using sessions::SyncSessionSnapshot; | 89 using sessions::SyncSessionSnapshot; |
| 90 using syncable::GET_BY_HANDLE; | 90 using syncable::GET_BY_HANDLE; |
| 91 using syncable::IS_DEL; | 91 using syncable::IS_DEL; |
| 92 using syncable::IS_UNSYNCED; | 92 using syncable::IS_UNSYNCED; |
| 93 using syncable::NON_UNIQUE_NAME; | 93 using syncable::NON_UNIQUE_NAME; |
| 94 using syncable::SPECIFICS; | 94 using syncable::SPECIFICS; |
| 95 using syncable::kEncryptedString; | 95 using syncable::kEncryptedString; |
| 96 | 96 |
| 97 namespace { | 97 namespace { |
| 98 | 98 |
| 99 const char kTestChromeVersion[] = "test chrome version"; | |
| 100 | |
| 101 void ExpectInt64Value(int64 expected_value, | 99 void ExpectInt64Value(int64 expected_value, |
| 102 const base::DictionaryValue& value, | 100 const base::DictionaryValue& value, |
| 103 const std::string& key) { | 101 const std::string& key) { |
| 104 std::string int64_str; | 102 std::string int64_str; |
| 105 EXPECT_TRUE(value.GetString(key, &int64_str)); | 103 EXPECT_TRUE(value.GetString(key, &int64_str)); |
| 106 int64 val = 0; | 104 int64 val = 0; |
| 107 EXPECT_TRUE(base::StringToInt64(int64_str, &val)); | 105 EXPECT_TRUE(base::StringToInt64(int64_str, &val)); |
| 108 EXPECT_EQ(expected_value, val); | 106 EXPECT_EQ(expected_value, val); |
| 109 } | 107 } |
| 110 | 108 |
| (...skipping 3402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3513 size_t folder_b_pos = | 3511 size_t folder_b_pos = |
| 3514 FindChangeInList(folder_b_id, ChangeRecord::ACTION_DELETE); | 3512 FindChangeInList(folder_b_id, ChangeRecord::ACTION_DELETE); |
| 3515 size_t child_pos = FindChangeInList(child_id, ChangeRecord::ACTION_DELETE); | 3513 size_t child_pos = FindChangeInList(child_id, ChangeRecord::ACTION_DELETE); |
| 3516 | 3514 |
| 3517 // Deletes should appear before updates. | 3515 // Deletes should appear before updates. |
| 3518 EXPECT_LT(child_pos, folder_a_pos); | 3516 EXPECT_LT(child_pos, folder_a_pos); |
| 3519 EXPECT_LT(folder_b_pos, folder_a_pos); | 3517 EXPECT_LT(folder_b_pos, folder_a_pos); |
| 3520 } | 3518 } |
| 3521 | 3519 |
| 3522 } // namespace | 3520 } // namespace |
| OLD | NEW |