| 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 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 (*out)[PRIORITY_PREFERENCES] = GROUP_PASSIVE; | 896 (*out)[PRIORITY_PREFERENCES] = GROUP_PASSIVE; |
| 897 (*out)[ARTICLES] = GROUP_PASSIVE; | 897 (*out)[ARTICLES] = GROUP_PASSIVE; |
| 898 } | 898 } |
| 899 | 899 |
| 900 ModelTypeSet GetEnabledTypes() { | 900 ModelTypeSet GetEnabledTypes() { |
| 901 ModelSafeRoutingInfo routing_info; | 901 ModelSafeRoutingInfo routing_info; |
| 902 GetModelSafeRoutingInfo(&routing_info); | 902 GetModelSafeRoutingInfo(&routing_info); |
| 903 return GetRoutingInfoTypes(routing_info); | 903 return GetRoutingInfoTypes(routing_info); |
| 904 } | 904 } |
| 905 | 905 |
| 906 virtual void OnChangesApplied( | 906 void OnChangesApplied( |
| 907 ModelType model_type, | 907 ModelType model_type, |
| 908 int64 model_version, | 908 int64 model_version, |
| 909 const BaseTransaction* trans, | 909 const BaseTransaction* trans, |
| 910 const ImmutableChangeRecordList& changes) override {} | 910 const ImmutableChangeRecordList& changes) override {} |
| 911 | 911 |
| 912 virtual void OnChangesComplete(ModelType model_type) override {} | 912 void OnChangesComplete(ModelType model_type) override {} |
| 913 | 913 |
| 914 // Helper methods. | 914 // Helper methods. |
| 915 bool SetUpEncryption(NigoriStatus nigori_status, | 915 bool SetUpEncryption(NigoriStatus nigori_status, |
| 916 EncryptionStatus encryption_status) { | 916 EncryptionStatus encryption_status) { |
| 917 UserShare* share = sync_manager_.GetUserShare(); | 917 UserShare* share = sync_manager_.GetUserShare(); |
| 918 | 918 |
| 919 // We need to create the nigori node as if it were an applied server update. | 919 // We need to create the nigori node as if it were an applied server update. |
| 920 int64 nigori_id = GetIdForDataType(NIGORI); | 920 int64 nigori_id = GetIdForDataType(NIGORI); |
| 921 if (nigori_id == kInvalidId) | 921 if (nigori_id == kInvalidId) |
| 922 return false; | 922 return false; |
| (...skipping 2274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3197 // SyncManagerInitInvalidStorageTest::GetFactory will return | 3197 // SyncManagerInitInvalidStorageTest::GetFactory will return |
| 3198 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. | 3198 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. |
| 3199 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's | 3199 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's |
| 3200 // task is to ensure that SyncManagerImpl reported initialization failure in | 3200 // task is to ensure that SyncManagerImpl reported initialization failure in |
| 3201 // OnInitializationComplete callback. | 3201 // OnInitializationComplete callback. |
| 3202 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { | 3202 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { |
| 3203 EXPECT_FALSE(initialization_succeeded_); | 3203 EXPECT_FALSE(initialization_succeeded_); |
| 3204 } | 3204 } |
| 3205 | 3205 |
| 3206 } // namespace syncer | 3206 } // namespace syncer |
| OLD | NEW |