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 android.content.DialogInterface; | 7 import android.content.DialogInterface; |
8 import android.support.test.filters.MediumTest; | 8 import android.support.test.filters.MediumTest; |
9 | 9 |
10 import org.chromium.base.test.util.Feature; | 10 import org.chromium.base.test.util.Feature; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // Check the labels of the instruments. | 132 // Check the labels of the instruments. |
133 int i = 0; | 133 int i = 0; |
134 if (instrumentPresence == HAVE_INSTRUMENTS) { | 134 if (instrumentPresence == HAVE_INSTRUMENTS) { |
135 assertEquals("https://bobpay.com", getPaymentInstrumentLabel(i++)); | 135 assertEquals("https://bobpay.com", getPaymentInstrumentLabel(i++)); |
136 } | 136 } |
137 // \u0020\...\u2006 is four dots ellipsis. | 137 // \u0020\...\u2006 is four dots ellipsis. |
138 assertEquals( | 138 assertEquals( |
139 "Visa\u0020\u0020\u2022\u2006\u2022\u2006\u2022\u2006\u2022\u200
61111\nJon Doe", | 139 "Visa\u0020\u0020\u2022\u2006\u2022\u2006\u2022\u2006\u2022\u200
61111\nJon Doe", |
140 getPaymentInstrumentLabel(i++)); | 140 getPaymentInstrumentLabel(i++)); |
141 assertEquals( | 141 assertEquals( |
142 "MasterCard\u0020\u0020\u2022\u2006\u2022\u2006\u2022\u2006\u202
2\u20065454\n" | 142 "Mastercard\u0020\u0020\u2022\u2006\u2022\u2006\u2022\u2006\u202
2\u20065454\n" |
143 + "Jon Doe\nBilling address required", | 143 + "Jon Doe\nBilling address required", |
144 getPaymentInstrumentLabel(i++)); | 144 getPaymentInstrumentLabel(i++)); |
145 | 145 |
146 // Check the output of the selected instrument. | 146 // Check the output of the selected instrument. |
147 if (instrumentPresence == HAVE_INSTRUMENTS) { | 147 if (instrumentPresence == HAVE_INSTRUMENTS) { |
148 clickAndWait(R.id.button_primary, mDismissed); | 148 clickAndWait(R.id.button_primary, mDismissed); |
149 expectResultContains(new String[]{"https://bobpay.com", "\"transacti
on\"", "1337"}); | 149 expectResultContains(new String[]{"https://bobpay.com", "\"transacti
on\"", "1337"}); |
150 } else { | 150 } else { |
151 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); | 151 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); |
152 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mRea
dyToUnmask); | 152 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mRea
dyToUnmask); |
153 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismi
ssed); | 153 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismi
ssed); |
154 expectResultContains(new String[] {"Jon Doe", "4111111111111111", "1
2", "2050", "visa", | 154 expectResultContains(new String[] {"Jon Doe", "4111111111111111", "1
2", "2050", "visa", |
155 "123"}); | 155 "123"}); |
156 } | 156 } |
157 } | 157 } |
158 } | 158 } |
OLD | NEW |