| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/payments/payment_app_content_unittest_base.h" | 5 #include "content/browser/payments/payment_app_content_unittest_base.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 // Create a new payment manager. | 131 // Create a new payment manager. |
| 132 payments::mojom::PaymentManagerPtr manager; | 132 payments::mojom::PaymentManagerPtr manager; |
| 133 mojo::InterfaceRequest<payments::mojom::PaymentManager> request = | 133 mojo::InterfaceRequest<payments::mojom::PaymentManager> request = |
| 134 mojo::MakeRequest(&manager); | 134 mojo::MakeRequest(&manager); |
| 135 payment_managers_.push_back(std::move(manager)); | 135 payment_managers_.push_back(std::move(manager)); |
| 136 payment_app_context()->CreatePaymentManager(service_manager::BindSourceInfo(), | 136 payment_app_context()->CreatePaymentManager(service_manager::BindSourceInfo(), |
| 137 std::move(request)); | 137 std::move(request)); |
| 138 base::RunLoop().RunUntilIdle(); | 138 base::RunLoop().RunUntilIdle(); |
| 139 | 139 |
| 140 // Skip payment app info fetch since the provider host doesn't exist. |
| 141 payment_app_context() |
| 142 ->payment_app_database() |
| 143 ->SetSkipPaymentAppInfoFetchForTest(); |
| 144 |
| 140 // Find a last registered payment manager. | 145 // Find a last registered payment manager. |
| 141 for (const auto& candidate_manager : | 146 for (const auto& candidate_manager : |
| 142 payment_app_context()->payment_managers_) { | 147 payment_app_context()->payment_managers_) { |
| 143 if (!base::ContainsKey(existing_managers, candidate_manager.first)) { | 148 if (!base::ContainsKey(existing_managers, candidate_manager.first)) { |
| 144 candidate_manager.first->Init(scope_url.spec()); | 149 candidate_manager.first->Init(sw_script_url.spec(), scope_url.spec()); |
| 145 base::RunLoop().RunUntilIdle(); | 150 base::RunLoop().RunUntilIdle(); |
| 146 return candidate_manager.first; | 151 return candidate_manager.first; |
| 147 } | 152 } |
| 148 } | 153 } |
| 149 | 154 |
| 150 NOTREACHED(); | 155 NOTREACHED(); |
| 151 return nullptr; | 156 return nullptr; |
| 152 } | 157 } |
| 153 | 158 |
| 154 void PaymentAppContentUnitTestBase::UnregisterServiceWorker( | 159 void PaymentAppContentUnitTestBase::UnregisterServiceWorker( |
| (...skipping 17 matching lines...) Expand all Loading... |
| 172 StoragePartitionImpl* PaymentAppContentUnitTestBase::storage_partition() { | 177 StoragePartitionImpl* PaymentAppContentUnitTestBase::storage_partition() { |
| 173 return static_cast<StoragePartitionImpl*>( | 178 return static_cast<StoragePartitionImpl*>( |
| 174 BrowserContext::GetDefaultStoragePartition(browser_context())); | 179 BrowserContext::GetDefaultStoragePartition(browser_context())); |
| 175 } | 180 } |
| 176 | 181 |
| 177 PaymentAppContextImpl* PaymentAppContentUnitTestBase::payment_app_context() { | 182 PaymentAppContextImpl* PaymentAppContentUnitTestBase::payment_app_context() { |
| 178 return storage_partition()->GetPaymentAppContext(); | 183 return storage_partition()->GetPaymentAppContext(); |
| 179 } | 184 } |
| 180 | 185 |
| 181 } // namespace content | 186 } // namespace content |
| OLD | NEW |