| 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.os.Build; | 8 import android.os.Build; |
| 9 import android.support.test.filters.MediumTest; | 9 import android.support.test.filters.MediumTest; |
| 10 | 10 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 setTextInEditorAndWait(new String[] {"Bob", "Google", "1600 Amphitheatre
Pkwy", | 185 setTextInEditorAndWait(new String[] {"Bob", "Google", "1600 Amphitheatre
Pkwy", |
| 186 "Mountain View", "CA", "94043", "650-253-0000"}, mEditorTextUpda
te); | 186 "Mountain View", "CA", "94043", "650-253-0000"}, mEditorTextUpda
te); |
| 187 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToEdit); | 187 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToEdit); |
| 188 | 188 |
| 189 clickInCardEditorAndWait(R.id.payments_edit_done_button, mReadyToPay); | 189 clickInCardEditorAndWait(R.id.payments_edit_done_button, mReadyToPay); |
| 190 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); | 190 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); |
| 191 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyTo
Unmask); | 191 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyTo
Unmask); |
| 192 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed
); | 192 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed
); |
| 193 expectResultContains(new String[] {"5454545454545454", "12", "Bob", "Goo
gle", | 193 expectResultContains(new String[] {"5454545454545454", "12", "Bob", "Goo
gle", |
| 194 "1600 Amphitheatre Pkwy", "Mountain View", "CA", "94043", "+1 65
0-253-0000"}); | 194 "1600 Amphitheatre Pkwy", "Mountain View", "CA", "94043", "+1650
2530000"}); |
| 195 } | 195 } |
| 196 | 196 |
| 197 /** Quickly pressing on "add card" and then [X] should not crash. */ | 197 /** Quickly pressing on "add card" and then [X] should not crash. */ |
| 198 @MediumTest | 198 @MediumTest |
| 199 @Feature({"Payments"}) | 199 @Feature({"Payments"}) |
| 200 public void testQuickAddCardAndCloseShouldNotCrash() | 200 public void testQuickAddCardAndCloseShouldNotCrash() |
| 201 throws InterruptedException, ExecutionException, TimeoutException { | 201 throws InterruptedException, ExecutionException, TimeoutException { |
| 202 triggerUIAndWait(mReadyToPay); | 202 triggerUIAndWait(mReadyToPay); |
| 203 clickInPaymentMethodAndWait(R.id.payments_section, mReadyForInput); | 203 clickInPaymentMethodAndWait(R.id.payments_section, mReadyForInput); |
| 204 | 204 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 triggerUIAndWait(mReadyToPay); | 375 triggerUIAndWait(mReadyToPay); |
| 376 | 376 |
| 377 // Make sure that only the appropriate enum value was logged. | 377 // Make sure that only the appropriate enum value was logged. |
| 378 for (int i = 0; i < PaymentRequestMetrics.REQUESTED_INFORMATION_MAX; ++i
) { | 378 for (int i = 0; i < PaymentRequestMetrics.REQUESTED_INFORMATION_MAX; ++i
) { |
| 379 assertEquals((i == PaymentRequestMetrics.REQUESTED_INFORMATION_NONE
? 1 : 0), | 379 assertEquals((i == PaymentRequestMetrics.REQUESTED_INFORMATION_NONE
? 1 : 0), |
| 380 RecordHistogram.getHistogramValueCountForTesting( | 380 RecordHistogram.getHistogramValueCountForTesting( |
| 381 "PaymentRequest.RequestedInformation", i)); | 381 "PaymentRequest.RequestedInformation", i)); |
| 382 } | 382 } |
| 383 } | 383 } |
| 384 } | 384 } |
| OLD | NEW |