Chromium Code Reviews| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 243 public void testBillingAddressSortedByFrecency_AddNewAddress() | 243 public void testBillingAddressSortedByFrecency_AddNewAddress() |
| 244 throws InterruptedException, ExecutionException, TimeoutException { | 244 throws InterruptedException, ExecutionException, TimeoutException { |
| 245 // Add a payment method. | 245 // Add a payment method. |
| 246 triggerUIAndWait(mReadyToPay); | 246 triggerUIAndWait(mReadyToPay); |
| 247 clickInPaymentMethodAndWait(R.id.payments_section, mReadyForInput); | 247 clickInPaymentMethodAndWait(R.id.payments_section, mReadyForInput); |
| 248 clickInPaymentMethodAndWait(R.id.payments_add_option_button, mReadyToEdi t); | 248 clickInPaymentMethodAndWait(R.id.payments_add_option_button, mReadyToEdi t); |
| 249 | 249 |
| 250 // Add a new billing address. | 250 // Add a new billing address. |
| 251 setSpinnerSelectionsInCardEditorAndWait( | 251 setSpinnerSelectionsInCardEditorAndWait( |
| 252 new int[] {DECEMBER, NEXT_YEAR, ADD_BILLING_ADDRESS}, mReadyToEd it); | 252 new int[] {DECEMBER, NEXT_YEAR, ADD_BILLING_ADDRESS}, mReadyToEd it); |
| 253 | |
|
sebsg
2017/03/21 15:29:51
nit: Remove new-line
Parastoo
2017/03/21 20:05:51
Done.
| |
| 253 setTextInEditorAndWait(new String[] {"Seb Doe", "Google", "340 Main St", "Los Angeles", | 254 setTextInEditorAndWait(new String[] {"Seb Doe", "Google", "340 Main St", "Los Angeles", |
| 254 "CA", "90291", "650-253-0000"}, mEditorTextUpdate); | 255 "CA", "90291", "650-253-0000"}, mEditorTextUpdate); |
| 255 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToEdit); | 256 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToEdit); |
| 256 | 257 |
| 257 // There should be 9 suggestions, the 7 initial addresses, the newly add ed address and the | 258 // There should be 9 suggestions, the 7 initial addresses, the newly add ed address and the |
| 258 // option to add a new address. | 259 // option to add a new address. |
| 259 assertEquals(9, getSpinnerItemCountInCardEditor(BILLING_ADDRESS_DROPDOWN _INDEX)); | 260 assertEquals(9, getSpinnerItemCountInCardEditor(BILLING_ADDRESS_DROPDOWN _INDEX)); |
| 260 | 261 |
| 261 // The fist suggestion should be the newly added address. | 262 // The fist suggestion should be the newly added address. |
| 262 assertTrue(getSpinnerTextAtPositionInCardEditor(BILLING_ADDRESS_DROPDOWN _INDEX, | 263 assertTrue(getSpinnerTextAtPositionInCardEditor(BILLING_ADDRESS_DROPDOWN _INDEX, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 362 // Selects the fifth billing addresss that misses recipient name brings up the address | 363 // Selects the fifth billing addresss that misses recipient name brings up the address |
| 363 // editor. | 364 // editor. |
| 364 setSpinnerSelectionsInCardEditorAndWait(new int[] {DECEMBER, NEXT_YEAR, 4}, mReadyToEdit); | 365 setSpinnerSelectionsInCardEditorAndWait(new int[] {DECEMBER, NEXT_YEAR, 4}, mReadyToEdit); |
| 365 clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToEdit); | 366 clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToEdit); |
| 366 | 367 |
| 367 // The previous selected address should be selected after canceling out from edit. | 368 // The previous selected address should be selected after canceling out from edit. |
| 368 assertTrue(getSpinnerSelectionTextInCardEditor(BILLING_ADDRESS_DROPDOWN_ INDEX) | 369 assertTrue(getSpinnerSelectionTextInCardEditor(BILLING_ADDRESS_DROPDOWN_ INDEX) |
| 369 .equals("Jon Doe, 340 Main St, Los Angeles, CA 90291")); | 370 .equals("Jon Doe, 340 Main St, Los Angeles, CA 90291")); |
| 370 } | 371 } |
| 371 } | 372 } |
| OLD | NEW |