OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #import "ios/chrome/browser/payments/payment_request_coordinator.h" | 5 #import "ios/chrome/browser/payments/payment_request_coordinator.h" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/test/ios/wait_util.h" | 10 #include "base/test/ios/wait_util.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 @selector(paymentRequestCoordinator:didConfirmWithPaymentResponse:); | 151 @selector(paymentRequestCoordinator:didConfirmWithPaymentResponse:); |
152 [delegate_mock onSelector:selector | 152 [delegate_mock onSelector:selector |
153 callBlockExpectation:^(PaymentRequestCoordinator* callerCoordinator, | 153 callBlockExpectation:^(PaymentRequestCoordinator* callerCoordinator, |
154 web::PaymentResponse paymentResponse) { | 154 web::PaymentResponse paymentResponse) { |
155 EXPECT_EQ(base::ASCIIToUTF16("4111111111111111"), | 155 EXPECT_EQ(base::ASCIIToUTF16("4111111111111111"), |
156 paymentResponse.details.card_number); | 156 paymentResponse.details.card_number); |
157 EXPECT_EQ(base::ASCIIToUTF16("Test User"), | 157 EXPECT_EQ(base::ASCIIToUTF16("Test User"), |
158 paymentResponse.details.cardholder_name); | 158 paymentResponse.details.cardholder_name); |
159 EXPECT_EQ(base::ASCIIToUTF16("11"), | 159 EXPECT_EQ(base::ASCIIToUTF16("11"), |
160 paymentResponse.details.expiry_month); | 160 paymentResponse.details.expiry_month); |
161 EXPECT_EQ(base::ASCIIToUTF16("2017"), | 161 EXPECT_EQ(base::ASCIIToUTF16("2022"), |
162 paymentResponse.details.expiry_year); | 162 paymentResponse.details.expiry_year); |
163 EXPECT_EQ(base::ASCIIToUTF16("123"), | 163 EXPECT_EQ(base::ASCIIToUTF16("123"), |
164 paymentResponse.details.card_security_code); | 164 paymentResponse.details.card_security_code); |
165 EXPECT_EQ(coordinator, callerCoordinator); | 165 EXPECT_EQ(coordinator, callerCoordinator); |
166 }]; | 166 }]; |
167 [coordinator setDelegate:delegate_mock]; | 167 [coordinator setDelegate:delegate_mock]; |
168 | 168 |
169 // Call the card unmasking delegate method. | 169 // Call the card unmasking delegate method. |
170 [coordinator fullCardRequestDidSucceedWithCard:credit_card_ | 170 [coordinator fullCardRequestDidSucceedWithCard:credit_card_ |
171 CVC:base::ASCIIToUTF16("123")]; | 171 CVC:base::ASCIIToUTF16("123")]; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 [coordinator setDelegate:delegate_mock]; | 278 [coordinator setDelegate:delegate_mock]; |
279 [coordinator setBrowserState:browser_state_.get()]; | 279 [coordinator setBrowserState:browser_state_.get()]; |
280 | 280 |
281 [coordinator start]; | 281 [coordinator start]; |
282 // Short delay to allow animation to complete. | 282 // Short delay to allow animation to complete. |
283 base::test::ios::SpinRunLoopWithMaxDelay(base::TimeDelta::FromSecondsD(1)); | 283 base::test::ios::SpinRunLoopWithMaxDelay(base::TimeDelta::FromSecondsD(1)); |
284 | 284 |
285 // Call the controller delegate method. | 285 // Call the controller delegate method. |
286 [coordinator paymentRequestViewControllerDidCancel:nil]; | 286 [coordinator paymentRequestViewControllerDidCancel:nil]; |
287 } | 287 } |
OLD | NEW |