| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // managers before creating a new manager and then check what is a new thing. | 73 // managers before creating a new manager and then check what is a new thing. |
| 74 std::set<PaymentAppManager*> existing_managers; | 74 std::set<PaymentAppManager*> existing_managers; |
| 75 for (const auto& existing_manager : | 75 for (const auto& existing_manager : |
| 76 payment_app_context_->payment_app_managers_) { | 76 payment_app_context_->payment_app_managers_) { |
| 77 existing_managers.insert(existing_manager.first); | 77 existing_managers.insert(existing_manager.first); |
| 78 } | 78 } |
| 79 | 79 |
| 80 // Create a new payment app manager. | 80 // Create a new payment app manager. |
| 81 payments::mojom::PaymentAppManagerPtr manager; | 81 payments::mojom::PaymentAppManagerPtr manager; |
| 82 mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request = | 82 mojo::InterfaceRequest<payments::mojom::PaymentAppManager> request = |
| 83 mojo::GetProxy(&manager); | 83 mojo::MakeRequest(&manager); |
| 84 payment_app_managers_.push_back(std::move(manager)); | 84 payment_app_managers_.push_back(std::move(manager)); |
| 85 payment_app_context_->CreatePaymentAppManager(std::move(request)); | 85 payment_app_context_->CreatePaymentAppManager(std::move(request)); |
| 86 base::RunLoop().RunUntilIdle(); | 86 base::RunLoop().RunUntilIdle(); |
| 87 | 87 |
| 88 // Find a last registered payment app manager. | 88 // Find a last registered payment app manager. |
| 89 for (const auto& candidate_manager : | 89 for (const auto& candidate_manager : |
| 90 payment_app_context_->payment_app_managers_) { | 90 payment_app_context_->payment_app_managers_) { |
| 91 if (!base::ContainsKey(existing_managers, candidate_manager.first)) | 91 if (!base::ContainsKey(existing_managers, candidate_manager.first)) |
| 92 return candidate_manager.first; | 92 return candidate_manager.first; |
| 93 } | 93 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 109 void PaymentAppContentUnitTestBase::GetManifest( | 109 void PaymentAppContentUnitTestBase::GetManifest( |
| 110 PaymentAppManager* manager, | 110 PaymentAppManager* manager, |
| 111 const std::string& scope, | 111 const std::string& scope, |
| 112 const PaymentAppManager::GetManifestCallback& callback) { | 112 const PaymentAppManager::GetManifestCallback& callback) { |
| 113 ASSERT_NE(nullptr, manager); | 113 ASSERT_NE(nullptr, manager); |
| 114 manager->GetManifest(scope, callback); | 114 manager->GetManifest(scope, callback); |
| 115 base::RunLoop().RunUntilIdle(); | 115 base::RunLoop().RunUntilIdle(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace content | 118 } // namespace content |
| OLD | NEW |