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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Find a last registered payment manager. | 140 // Find a last registered payment manager. |
141 for (const auto& candidate_manager : | 141 for (const auto& candidate_manager : |
142 payment_app_context()->payment_managers_) { | 142 payment_app_context()->payment_managers_) { |
143 if (!base::ContainsKey(existing_managers, candidate_manager.first)) { | 143 if (!base::ContainsKey(existing_managers, candidate_manager.first)) { |
144 candidate_manager.first->Init(scope_url.spec()); | 144 candidate_manager.first->Init(sw_script_url.spec(), scope_url.spec()); |
145 base::RunLoop().RunUntilIdle(); | 145 base::RunLoop().RunUntilIdle(); |
146 return candidate_manager.first; | 146 return candidate_manager.first; |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
150 NOTREACHED(); | 150 NOTREACHED(); |
151 return nullptr; | 151 return nullptr; |
152 } | 152 } |
153 | 153 |
154 void PaymentAppContentUnitTestBase::UnregisterServiceWorker( | 154 void PaymentAppContentUnitTestBase::UnregisterServiceWorker( |
(...skipping 17 matching lines...) Expand all Loading... |
172 StoragePartitionImpl* PaymentAppContentUnitTestBase::storage_partition() { | 172 StoragePartitionImpl* PaymentAppContentUnitTestBase::storage_partition() { |
173 return static_cast<StoragePartitionImpl*>( | 173 return static_cast<StoragePartitionImpl*>( |
174 BrowserContext::GetDefaultStoragePartition(browser_context())); | 174 BrowserContext::GetDefaultStoragePartition(browser_context())); |
175 } | 175 } |
176 | 176 |
177 PaymentAppContextImpl* PaymentAppContentUnitTestBase::payment_app_context() { | 177 PaymentAppContextImpl* PaymentAppContentUnitTestBase::payment_app_context() { |
178 return storage_partition()->GetPaymentAppContext(); | 178 return storage_partition()->GetPaymentAppContext(); |
179 } | 179 } |
180 | 180 |
181 } // namespace content | 181 } // namespace content |
OLD | NEW |