| 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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 const std::string GetResponseHeaderValue( | 794 const std::string GetResponseHeaderValue( |
| 795 const std::string& name) const override { | 795 const std::string& name) const override { |
| 796 return std::string(); | 796 return std::string(); |
| 797 } | 797 } |
| 798 void Abort() override {} | 798 void Abort() override {} |
| 799 }; | 799 }; |
| 800 | 800 |
| 801 class TestHttpPostProviderFactory : public HttpPostProviderFactory { | 801 class TestHttpPostProviderFactory : public HttpPostProviderFactory { |
| 802 public: | 802 public: |
| 803 ~TestHttpPostProviderFactory() override {} | 803 ~TestHttpPostProviderFactory() override {} |
| 804 void Init(const std::string& user_agent, | 804 void Init(const std::string& user_agent) override {} |
| 805 const BindToTrackerCallback& bind_to_tracker_callback) override {} | |
| 806 HttpPostProviderInterface* Create() override { | 805 HttpPostProviderInterface* Create() override { |
| 807 return new TestHttpPostProviderInterface(); | 806 return new TestHttpPostProviderInterface(); |
| 808 } | 807 } |
| 809 void Destroy(HttpPostProviderInterface* http) override { | 808 void Destroy(HttpPostProviderInterface* http) override { |
| 810 delete static_cast<TestHttpPostProviderInterface*>(http); | 809 delete static_cast<TestHttpPostProviderInterface*>(http); |
| 811 } | 810 } |
| 812 }; | 811 }; |
| 813 | 812 |
| 814 class SyncManagerObserverMock : public SyncManager::Observer { | 813 class SyncManagerObserverMock : public SyncManager::Observer { |
| 815 public: | 814 public: |
| (...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3356 // SyncManagerInitInvalidStorageTest::GetFactory will return | 3355 // SyncManagerInitInvalidStorageTest::GetFactory will return |
| 3357 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. | 3356 // DirectoryBackingStore that ensures that SyncManagerImpl::OpenDirectory fails. |
| 3358 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's | 3357 // SyncManagerImpl initialization is done in SyncManagerTest::SetUp. This test's |
| 3359 // task is to ensure that SyncManagerImpl reported initialization failure in | 3358 // task is to ensure that SyncManagerImpl reported initialization failure in |
| 3360 // OnInitializationComplete callback. | 3359 // OnInitializationComplete callback. |
| 3361 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { | 3360 TEST_F(SyncManagerInitInvalidStorageTest, FailToOpenDatabase) { |
| 3362 EXPECT_FALSE(initialization_succeeded_); | 3361 EXPECT_FALSE(initialization_succeeded_); |
| 3363 } | 3362 } |
| 3364 | 3363 |
| 3365 } // namespace syncer | 3364 } // namespace syncer |
| OLD | NEW |