| 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.support.test.filters.MediumTest; | 7 import android.support.test.filters.MediumTest; |
| 8 | 8 |
| 9 import org.chromium.base.test.util.Feature; | 9 import org.chromium.base.test.util.Feature; |
| 10 import org.chromium.chrome.R; | 10 import org.chromium.chrome.R; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 @MediumTest | 99 @MediumTest |
| 100 @Feature({"Payments"}) | 100 @Feature({"Payments"}) |
| 101 public void testShippingAddressFormat_NewAddress() | 101 public void testShippingAddressFormat_NewAddress() |
| 102 throws InterruptedException, ExecutionException, TimeoutException { | 102 throws InterruptedException, ExecutionException, TimeoutException { |
| 103 triggerUIAndWait(mReadyToPay); | 103 triggerUIAndWait(mReadyToPay); |
| 104 | 104 |
| 105 // Add a shipping address. | 105 // Add a shipping address. |
| 106 clickInShippingSummaryAndWait(R.id.payments_section, mReadyForInput); | 106 clickInShippingSummaryAndWait(R.id.payments_section, mReadyForInput); |
| 107 clickInShippingAddressAndWait(R.id.payments_add_option_button, mReadyToE
dit); | 107 clickInShippingAddressAndWait(R.id.payments_add_option_button, mReadyToE
dit); |
| 108 setTextInEditorAndWait(new String[] {"Seb Doe", "Google", "340 Main St",
"Los Angeles", | 108 setTextInEditorAndWait(new String[] {"Seb Doe", "Google", "340 Main St",
"Los Angeles", |
| 109 "CA", "90291", "555-555-5555"}, mEditorTextUpdate); | 109 "90291", "555-555-5555"}, |
| 110 mEditorTextUpdate); |
| 111 setSpinnerSelectionsInEditorAndWait(new int[] {US, CA}, mEditorTextUpdat
e); |
| 110 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToPay); | 112 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToPay); |
| 111 | 113 |
| 112 // Make sure that the shipping label does not include the country. | 114 // Make sure that the shipping label does not include the country. |
| 113 assertTrue(getShippingAddressOptionRowAtIndex(0).getLabelText().toString
().equals( | 115 assertTrue(getShippingAddressOptionRowAtIndex(0).getLabelText().toString
().equals( |
| 114 "Seb Doe\nGoogle, 340 Main St, Los Angeles, CA 90291\n555-555-55
55")); | 116 "Seb Doe\nGoogle, 340 Main St, Los Angeles, CA 90291\n555-555-55
55")); |
| 115 } | 117 } |
| 116 | 118 |
| 117 /** | 119 /** |
| 118 * Test that going into the editor and clicking 'CANCEL' button to cancel ed
itor will leave the | 120 * Test that going into the editor and clicking 'CANCEL' button to cancel ed
itor will leave the |
| 119 * row checked. | 121 * row checked. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 expectShippingAddressRowIsSelected(0); | 189 expectShippingAddressRowIsSelected(0); |
| 188 clickInShippingAddressAndWait(R.id.payments_add_option_button, mReadyToE
dit); | 190 clickInShippingAddressAndWait(R.id.payments_add_option_button, mReadyToE
dit); |
| 189 | 191 |
| 190 // Cancel the editor by clicking Android back button. | 192 // Cancel the editor by clicking Android back button. |
| 191 clickAndroidBackButtonInEditorAndWait(mReadyToPay); | 193 clickAndroidBackButtonInEditorAndWait(mReadyToPay); |
| 192 | 194 |
| 193 // Expect the existing row to still be selected in the Shipping Address
section. | 195 // Expect the existing row to still be selected in the Shipping Address
section. |
| 194 expectShippingAddressRowIsSelected(0); | 196 expectShippingAddressRowIsSelected(0); |
| 195 } | 197 } |
| 196 } | 198 } |
| OLD | NEW |