OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 using syncable::IS_DEL; | 87 using syncable::IS_DEL; |
88 using syncable::IS_UNSYNCED; | 88 using syncable::IS_UNSYNCED; |
89 using syncable::kEncryptedString; | 89 using syncable::kEncryptedString; |
90 using syncable::NON_UNIQUE_NAME; | 90 using syncable::NON_UNIQUE_NAME; |
91 using syncable::SPECIFICS; | 91 using syncable::SPECIFICS; |
92 | 92 |
93 namespace { | 93 namespace { |
94 | 94 |
95 const char kTestChromeVersion[] = "test chrome version"; | 95 const char kTestChromeVersion[] = "test chrome version"; |
96 | 96 |
97 void DoNothing() {} | |
98 | |
99 void ExpectInt64Value(int64 expected_value, | 97 void ExpectInt64Value(int64 expected_value, |
100 const DictionaryValue& value, const std::string& key) { | 98 const DictionaryValue& value, const std::string& key) { |
101 std::string int64_str; | 99 std::string int64_str; |
102 EXPECT_TRUE(value.GetString(key, &int64_str)); | 100 EXPECT_TRUE(value.GetString(key, &int64_str)); |
103 int64 val = 0; | 101 int64 val = 0; |
104 EXPECT_TRUE(base::StringToInt64(int64_str, &val)); | 102 EXPECT_TRUE(base::StringToInt64(int64_str, &val)); |
105 EXPECT_EQ(expected_value, val); | 103 EXPECT_EQ(expected_value, val); |
106 } | 104 } |
107 | 105 |
108 void ExpectTimeValue(const base::Time& expected_value, | 106 void ExpectTimeValue(const base::Time& expected_value, |
(...skipping 2775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2884 | 2882 |
2885 // Verify only the non-disabled types remain after cleanup. | 2883 // Verify only the non-disabled types remain after cleanup. |
2886 sync_manager_.PurgeDisabledTypes(enabled_types, new_enabled_types); | 2884 sync_manager_.PurgeDisabledTypes(enabled_types, new_enabled_types); |
2887 EXPECT_TRUE(new_enabled_types.Equals( | 2885 EXPECT_TRUE(new_enabled_types.Equals( |
2888 Union(sync_manager_.InitialSyncEndedTypes(), partial_enabled_types))); | 2886 Union(sync_manager_.InitialSyncEndedTypes(), partial_enabled_types))); |
2889 EXPECT_TRUE(disabled_types.Equals( | 2887 EXPECT_TRUE(disabled_types.Equals( |
2890 sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All()))); | 2888 sync_manager_.GetTypesWithEmptyProgressMarkerToken(ModelTypeSet::All()))); |
2891 } | 2889 } |
2892 | 2890 |
2893 } // namespace | 2891 } // namespace |
OLD | NEW |