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 <cstddef> | 5 #include <cstddef> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 128 } |
129 | 129 |
130 PaymentAppProvider::Manifests manifests; | 130 PaymentAppProvider::Manifests manifests; |
131 bool called = false; | 131 bool called = false; |
132 GetAllManifests(base::Bind(&GetAllManifestsCallback, &called, &manifests)); | 132 GetAllManifests(base::Bind(&GetAllManifestsCallback, &called, &manifests)); |
133 ASSERT_TRUE(called); | 133 ASSERT_TRUE(called); |
134 ASSERT_EQ(3U, manifests.size()); | 134 ASSERT_EQ(3U, manifests.size()); |
135 | 135 |
136 payments::mojom::PaymentAppRequestPtr app_request = | 136 payments::mojom::PaymentAppRequestPtr app_request = |
137 payments::mojom::PaymentAppRequest::New(); | 137 payments::mojom::PaymentAppRequest::New(); |
138 app_request->methodData.push_back(payments::mojom::PaymentMethodData::New()); | 138 app_request->method_data.push_back(payments::mojom::PaymentMethodData::New()); |
139 app_request->total = payments::mojom::PaymentItem::New(); | 139 app_request->total = payments::mojom::PaymentItem::New(); |
140 app_request->total->amount = payments::mojom::PaymentCurrencyAmount::New(); | 140 app_request->total->amount = payments::mojom::PaymentCurrencyAmount::New(); |
141 | 141 |
142 called = false; | 142 called = false; |
143 InvokePaymentApp(manifests[1].first, std::move(app_request), | 143 InvokePaymentApp(manifests[1].first, std::move(app_request), |
144 base::Bind(&InvokePaymentAppCallback, &called)); | 144 base::Bind(&InvokePaymentAppCallback, &called)); |
145 ASSERT_TRUE(called); | 145 ASSERT_TRUE(called); |
146 | 146 |
147 EXPECT_EQ(manifests[1].first, last_sw_registration_id()); | 147 EXPECT_EQ(manifests[1].first, last_sw_registration_id()); |
148 EXPECT_EQ(GURL(kPaymentAppInfo[1].scopeUrl), last_sw_scope_url()); | 148 EXPECT_EQ(GURL(kPaymentAppInfo[1].scopeUrl), last_sw_scope_url()); |
149 } | 149 } |
150 | 150 |
151 } // namespace content | 151 } // namespace content |
OLD | NEW |