| 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 "components/sync/core_impl/sync_manager_impl.h" | 9 #include "components/sync/core_impl/sync_manager_impl.h" |
| 10 | 10 |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 ModelSafeRoutingInfo routing_info; | 979 ModelSafeRoutingInfo routing_info; |
| 980 GetModelSafeRoutingInfo(&routing_info); | 980 GetModelSafeRoutingInfo(&routing_info); |
| 981 | 981 |
| 982 // This works only because all routing info types are GROUP_PASSIVE. | 982 // This works only because all routing info types are GROUP_PASSIVE. |
| 983 // If we had types in other groups, we would need additional workers | 983 // If we had types in other groups, we would need additional workers |
| 984 // to support them. | 984 // to support them. |
| 985 scoped_refptr<ModelSafeWorker> worker = new FakeModelWorker(GROUP_PASSIVE); | 985 scoped_refptr<ModelSafeWorker> worker = new FakeModelWorker(GROUP_PASSIVE); |
| 986 workers.push_back(worker); | 986 workers.push_back(worker); |
| 987 | 987 |
| 988 SyncManager::InitArgs args; | 988 SyncManager::InitArgs args; |
| 989 args.database_location = temp_dir_.path(); | 989 args.database_location = temp_dir_.GetPath(); |
| 990 args.service_url = GURL("https://example.com/"); | 990 args.service_url = GURL("https://example.com/"); |
| 991 args.post_factory = std::unique_ptr<HttpPostProviderFactory>( | 991 args.post_factory = std::unique_ptr<HttpPostProviderFactory>( |
| 992 new TestHttpPostProviderFactory()); | 992 new TestHttpPostProviderFactory()); |
| 993 args.workers = workers; | 993 args.workers = workers; |
| 994 args.extensions_activity = extensions_activity_.get(), | 994 args.extensions_activity = extensions_activity_.get(), |
| 995 args.change_delegate = this; | 995 args.change_delegate = this; |
| 996 args.credentials = credentials; | 996 args.credentials = credentials; |
| 997 args.invalidator_client_id = "fake_invalidator_client_id"; | 997 args.invalidator_client_id = "fake_invalidator_client_id"; |
| 998 args.internal_components_factory.reset(GetFactory()); | 998 args.internal_components_factory.reset(GetFactory()); |
| 999 args.encryptor = &encryptor_; | 999 args.encryptor = &encryptor_; |
| (...skipping 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3359 // SyncManagerInitInvalidStorageTest::GetFactory will return | 3359 // SyncManagerInitInvalidStorageTest::GetFactory will return |
| 3360 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. | 3360 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. |
| 3361 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's | 3361 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's |
| 3362 // task is to ensure that SyncManagerImpl reported initialization failure in | 3362 // task is to ensure that SyncManagerImpl reported initialization failure in |
| 3363 // OnInitializationComplete callback. | 3363 // OnInitializationComplete callback. |
| 3364 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { | 3364 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { |
| 3365 EXPECT_FALSE(initialization_succeeded_); | 3365 EXPECT_FALSE(initialization_succeeded_); |
| 3366 } | 3366 } |
| 3367 | 3367 |
| 3368 } // namespace syncer | 3368 } // namespace syncer |
| OLD | NEW |