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.junit.Assert; | 10 import org.junit.Assert; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 throws InterruptedException, ExecutionException, TimeoutException { | 128 throws InterruptedException, ExecutionException, TimeoutException { |
129 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead yToPay()); | 129 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead yToPay()); |
130 mPaymentRequestTestRule.clickInShippingAddressAndWait( | 130 mPaymentRequestTestRule.clickInShippingAddressAndWait( |
131 R.id.payments_section, mPaymentRequestTestRule.getReadyForInput( )); | 131 R.id.payments_section, mPaymentRequestTestRule.getReadyForInput( )); |
132 mPaymentRequestTestRule.clickInShippingAddressAndWait( | 132 mPaymentRequestTestRule.clickInShippingAddressAndWait( |
133 R.id.payments_add_option_button, mPaymentRequestTestRule.getRead yToEdit()); | 133 R.id.payments_add_option_button, mPaymentRequestTestRule.getRead yToEdit()); |
134 mPaymentRequestTestRule.setSpinnerSelectionInEditorAndWait( | 134 mPaymentRequestTestRule.setSpinnerSelectionInEditorAndWait( |
135 0 /* Afghanistan */, mPaymentRequestTestRule.getReadyToEdit()); | 135 0 /* Afghanistan */, mPaymentRequestTestRule.getReadyToEdit()); |
136 mPaymentRequestTestRule.setTextInEditorAndWait( | 136 mPaymentRequestTestRule.setTextInEditorAndWait( |
137 new String[] { | 137 new String[] { |
138 "Alice", "Supreme Court", "Airport Road", "Kabul", "1043 ", "650-253-0000"}, | 138 "Alice", "Supreme Court", "Airport Road", "Kabul", "1043 ", "020-253-0000"}, |
139 mPaymentRequestTestRule.getEditorTextUpdate()); | 139 mPaymentRequestTestRule.getEditorTextUpdate()); |
140 mPaymentRequestTestRule.clickInEditorAndWait( | 140 mPaymentRequestTestRule.clickInEditorAndWait( |
141 R.id.payments_edit_done_button, mPaymentRequestTestRule.getReady ToPay()); | 141 R.id.payments_edit_done_button, mPaymentRequestTestRule.getReady ToPay()); |
142 mPaymentRequestTestRule.clickAndWait( | 142 mPaymentRequestTestRule.clickAndWait( |
143 R.id.button_primary, mPaymentRequestTestRule.getReadyForUnmaskIn put()); | 143 R.id.button_primary, mPaymentRequestTestRule.getReadyForUnmaskIn put()); |
144 mPaymentRequestTestRule.setTextInCardUnmaskDialogAndWait( | 144 mPaymentRequestTestRule.setTextInCardUnmaskDialogAndWait( |
145 R.id.card_unmask_input, "123", mPaymentRequestTestRule.getReadyT oUnmask()); | 145 R.id.card_unmask_input, "123", mPaymentRequestTestRule.getReadyT oUnmask()); |
146 mPaymentRequestTestRule.clickCardUnmaskButtonAndWait( | 146 mPaymentRequestTestRule.clickCardUnmaskButtonAndWait( |
147 DialogInterface.BUTTON_POSITIVE, mPaymentRequestTestRule.getDism issed()); | 147 DialogInterface.BUTTON_POSITIVE, mPaymentRequestTestRule.getDism issed()); |
148 mPaymentRequestTestRule.expectResultContains(new String[] { | 148 mPaymentRequestTestRule.expectResultContains(new String[] { |
149 "Alice", "Supreme Court", "Airport Road", "Kabul", "1043", "+165 02530000"}); | 149 "Alice", "Supreme Court", "Airport Road", "Kabul", "1043", "+932 02530000"}); |
gogerald1
2017/06/08 16:20:43
why these numbers have to be changed?
wuandy1
2017/06/08 20:34:58
Test will hang because that is not a valid Afghani
| |
150 } | 150 } |
151 | 151 |
152 /** Quickly pressing on "add address" and then [X] should not crash. */ | 152 /** Quickly pressing on "add address" and then [X] should not crash. */ |
153 @Test | 153 @Test |
154 @MediumTest | 154 @MediumTest |
155 @Feature({"Payments"}) | 155 @Feature({"Payments"}) |
156 public void testQuickAddAddressAndCloseShouldNotCrash() | 156 public void testQuickAddAddressAndCloseShouldNotCrash() |
157 throws InterruptedException, ExecutionException, TimeoutException { | 157 throws InterruptedException, ExecutionException, TimeoutException { |
158 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead yToPay()); | 158 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead yToPay()); |
159 mPaymentRequestTestRule.clickInShippingAddressAndWait( | 159 mPaymentRequestTestRule.clickInShippingAddressAndWait( |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
291 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead yToPay()); | 291 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead yToPay()); |
292 | 292 |
293 // Make sure that only the appropriate enum value was logged. | 293 // Make sure that only the appropriate enum value was logged. |
294 for (int i = 0; i < RequestedInformation.MAX; ++i) { | 294 for (int i = 0; i < RequestedInformation.MAX; ++i) { |
295 Assert.assertEquals((i == RequestedInformation.SHIPPING ? 1 : 0), | 295 Assert.assertEquals((i == RequestedInformation.SHIPPING ? 1 : 0), |
296 RecordHistogram.getHistogramValueCountForTesting( | 296 RecordHistogram.getHistogramValueCountForTesting( |
297 "PaymentRequest.RequestedInformation", i)); | 297 "PaymentRequest.RequestedInformation", i)); |
298 } | 298 } |
299 } | 299 } |
300 } | 300 } |
OLD | NEW |