| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "components/invalidation/impl/ticl_invalidation_service.h" | 5 #include "components/invalidation/impl/ticl_invalidation_service.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 void CreateInvalidationService() { | 62 void CreateInvalidationService() { |
| 63 CreateUninitializedInvalidationService(); | 63 CreateUninitializedInvalidationService(); |
| 64 InitializeInvalidationService(); | 64 InitializeInvalidationService(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void CreateUninitializedInvalidationService() { | 67 void CreateUninitializedInvalidationService() { |
| 68 gcm_driver_.reset(new gcm::FakeGCMDriver()); | 68 gcm_driver_.reset(new gcm::FakeGCMDriver()); |
| 69 invalidation_service_.reset(new TiclInvalidationService( | 69 invalidation_service_.reset(new TiclInvalidationService( |
| 70 "TestUserAgent", | 70 "TestUserAgent", |
| 71 base::WrapUnique(new FakeIdentityProvider(&token_service_)), | 71 base::MakeUnique<FakeIdentityProvider>(&token_service_), |
| 72 std::unique_ptr<TiclSettingsProvider>(new FakeTiclSettingsProvider), | 72 std::unique_ptr<TiclSettingsProvider>(new FakeTiclSettingsProvider), |
| 73 gcm_driver_.get(), NULL)); | 73 gcm_driver_.get(), NULL)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void InitializeInvalidationService() { | 76 void InitializeInvalidationService() { |
| 77 fake_invalidator_ = new syncer::FakeInvalidator(); | 77 fake_invalidator_ = new syncer::FakeInvalidator(); |
| 78 invalidation_service_->InitForTest( | 78 invalidation_service_->InitForTest( |
| 79 base::WrapUnique(new syncer::FakeInvalidationStateTracker), | 79 base::WrapUnique(new syncer::FakeInvalidationStateTracker), |
| 80 fake_invalidator_); | 80 fake_invalidator_); |
| 81 } | 81 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 delegate->InitializeInvalidationService(); | 144 delegate->InitializeInvalidationService(); |
| 145 | 145 |
| 146 invalidator->RequestDetailedStatus( | 146 invalidator->RequestDetailedStatus( |
| 147 base::Bind(&internal::FakeCallbackContainer::FakeCallback, | 147 base::Bind(&internal::FakeCallbackContainer::FakeCallback, |
| 148 fake_container.weak_ptr_factory_.GetWeakPtr())); | 148 fake_container.weak_ptr_factory_.GetWeakPtr())); |
| 149 EXPECT_TRUE(fake_container.called_); | 149 EXPECT_TRUE(fake_container.called_); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace invalidation | 152 } // namespace invalidation |
| OLD | NEW |