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 package org.chromium.chrome.browser.payments; | 5 package org.chromium.chrome.browser.payments; |
6 | 6 |
7 import static org.chromium.chrome.browser.payments.PaymentRequestTestRule.DELAYE
D_RESPONSE; | 7 import static org.chromium.chrome.browser.payments.PaymentRequestTestRule.DELAYE
D_RESPONSE; |
8 import static org.chromium.chrome.browser.payments.PaymentRequestTestRule.HAVE_I
NSTRUMENTS; | 8 import static org.chromium.chrome.browser.payments.PaymentRequestTestRule.HAVE_I
NSTRUMENTS; |
9 import static org.chromium.chrome.browser.payments.PaymentRequestTestRule.IMMEDI
ATE_RESPONSE; | 9 import static org.chromium.chrome.browser.payments.PaymentRequestTestRule.IMMEDI
ATE_RESPONSE; |
10 import static org.chromium.chrome.browser.payments.PaymentRequestTestRule.NO_INS
TRUMENTS; | 10 import static org.chromium.chrome.browser.payments.PaymentRequestTestRule.NO_INS
TRUMENTS; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 int i = 0; | 166 int i = 0; |
167 if (instrumentPresence == HAVE_INSTRUMENTS) { | 167 if (instrumentPresence == HAVE_INSTRUMENTS) { |
168 Assert.assertEquals( | 168 Assert.assertEquals( |
169 "https://bobpay.com", mPaymentRequestTestRule.getPaymentInst
rumentLabel(i++)); | 169 "https://bobpay.com", mPaymentRequestTestRule.getPaymentInst
rumentLabel(i++)); |
170 } | 170 } |
171 // \u0020\...\u2006 is four dots ellipsis. | 171 // \u0020\...\u2006 is four dots ellipsis. |
172 Assert.assertEquals( | 172 Assert.assertEquals( |
173 "Visa\u0020\u0020\u2022\u2006\u2022\u2006\u2022\u2006\u2022\u200
61111\nJon Doe", | 173 "Visa\u0020\u0020\u2022\u2006\u2022\u2006\u2022\u2006\u2022\u200
61111\nJon Doe", |
174 mPaymentRequestTestRule.getPaymentInstrumentLabel(i++)); | 174 mPaymentRequestTestRule.getPaymentInstrumentLabel(i++)); |
175 Assert.assertEquals( | 175 Assert.assertEquals( |
176 "MasterCard\u0020\u0020\u2022\u2006\u2022\u2006\u2022\u2006\u202
2\u20065454\n" | 176 "Mastercard\u0020\u0020\u2022\u2006\u2022\u2006\u2022\u2006\u202
2\u20065454\n" |
177 + "Jon Doe\nBilling address required", | 177 + "Jon Doe\nBilling address required", |
178 mPaymentRequestTestRule.getPaymentInstrumentLabel(i++)); | 178 mPaymentRequestTestRule.getPaymentInstrumentLabel(i++)); |
179 | 179 |
180 // Check the output of the selected instrument. | 180 // Check the output of the selected instrument. |
181 if (instrumentPresence == HAVE_INSTRUMENTS) { | 181 if (instrumentPresence == HAVE_INSTRUMENTS) { |
182 mPaymentRequestTestRule.clickAndWait( | 182 mPaymentRequestTestRule.clickAndWait( |
183 R.id.button_primary, mPaymentRequestTestRule.getDismissed())
; | 183 R.id.button_primary, mPaymentRequestTestRule.getDismissed())
; |
184 mPaymentRequestTestRule.expectResultContains( | 184 mPaymentRequestTestRule.expectResultContains( |
185 new String[] {"https://bobpay.com", "\"transaction\"", "1337
"}); | 185 new String[] {"https://bobpay.com", "\"transaction\"", "1337
"}); |
186 } else { | 186 } else { |
187 mPaymentRequestTestRule.clickAndWait( | 187 mPaymentRequestTestRule.clickAndWait( |
188 R.id.button_primary, mPaymentRequestTestRule.getReadyForUnma
skInput()); | 188 R.id.button_primary, mPaymentRequestTestRule.getReadyForUnma
skInput()); |
189 mPaymentRequestTestRule.setTextInCardUnmaskDialogAndWait( | 189 mPaymentRequestTestRule.setTextInCardUnmaskDialogAndWait( |
190 R.id.card_unmask_input, "123", mPaymentRequestTestRule.getRe
adyToUnmask()); | 190 R.id.card_unmask_input, "123", mPaymentRequestTestRule.getRe
adyToUnmask()); |
191 mPaymentRequestTestRule.clickCardUnmaskButtonAndWait( | 191 mPaymentRequestTestRule.clickCardUnmaskButtonAndWait( |
192 DialogInterface.BUTTON_POSITIVE, mPaymentRequestTestRule.get
Dismissed()); | 192 DialogInterface.BUTTON_POSITIVE, mPaymentRequestTestRule.get
Dismissed()); |
193 mPaymentRequestTestRule.expectResultContains( | 193 mPaymentRequestTestRule.expectResultContains( |
194 new String[] {"Jon Doe", "4111111111111111", "12", "2050", "
visa", "123"}); | 194 new String[] {"Jon Doe", "4111111111111111", "12", "2050", "
visa", "123"}); |
195 } | 195 } |
196 } | 196 } |
197 } | 197 } |
OLD | NEW |