| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 "CA", "90291", "650-253-0000"}, mEditorTextUpdate); | 57 "CA", "90291", "650-253-0000"}, mEditorTextUpdate); |
| 58 // The contact is now complete, but not selected. | 58 // The contact is now complete, but not selected. |
| 59 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyForInput); | 59 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyForInput); |
| 60 // We select it. | 60 // We select it. |
| 61 clickInContactInfoAndWait(R.id.payments_section, mReadyForInput); | 61 clickInContactInfoAndWait(R.id.payments_section, mReadyForInput); |
| 62 assertEquals("Jon Doe\n+1 650-253-0000\njon.doe@google.com", | 62 assertEquals("Jon Doe\n+1 650-253-0000\njon.doe@google.com", |
| 63 getContactDetailsSuggestionLabel(0)); | 63 getContactDetailsSuggestionLabel(0)); |
| 64 clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToPay)
; | 64 clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToPay)
; |
| 65 | 65 |
| 66 clickAndWait(R.id.button_primary, mDismissed); | 66 clickAndWait(R.id.button_primary, mDismissed); |
| 67 expectResultContains(new String[] {"Jon Doe", "+1 650-253-0000", "jon.do
e@google.com"}); | 67 expectResultContains(new String[] {"Jon Doe", "+16502530000", "jon.doe@g
oogle.com"}); |
| 68 } | 68 } |
| 69 | 69 |
| 70 /** Add a shipping address with valid data and see that the contacts section
is updated. */ | 70 /** Add a shipping address with valid data and see that the contacts section
is updated. */ |
| 71 @MediumTest | 71 @MediumTest |
| 72 @Feature({"Payments"}) | 72 @Feature({"Payments"}) |
| 73 public void testEditIncompleteShippingAndContactAndPay() | 73 public void testEditIncompleteShippingAndContactAndPay() |
| 74 throws InterruptedException, ExecutionException, TimeoutException { | 74 throws InterruptedException, ExecutionException, TimeoutException { |
| 75 triggerUIAndWait(mReadyForInput); | 75 triggerUIAndWait(mReadyForInput); |
| 76 clickInShippingSummaryAndWait(R.id.payments_section, mReadyForInput); | 76 clickInShippingSummaryAndWait(R.id.payments_section, mReadyForInput); |
| 77 | 77 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 90 "Jane Doe\n+1 650-253-0000\nEmail required", getContactDetailsSu
ggestionLabel(1)); | 90 "Jane Doe\n+1 650-253-0000\nEmail required", getContactDetailsSu
ggestionLabel(1)); |
| 91 | 91 |
| 92 // Now edit the first contact and pay. | 92 // Now edit the first contact and pay. |
| 93 clickInContactInfoAndWait(R.id.payments_section, mReadyForInput); | 93 clickInContactInfoAndWait(R.id.payments_section, mReadyForInput); |
| 94 clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToEdit
); | 94 clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToEdit
); |
| 95 setTextInEditorAndWait( | 95 setTextInEditorAndWait( |
| 96 new String[] {"Jon Doe", "650-253-0000", "jon.doe@google.com"},
mEditorTextUpdate); | 96 new String[] {"Jon Doe", "650-253-0000", "jon.doe@google.com"},
mEditorTextUpdate); |
| 97 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToPay); | 97 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToPay); |
| 98 | 98 |
| 99 clickAndWait(R.id.button_primary, mDismissed); | 99 clickAndWait(R.id.button_primary, mDismissed); |
| 100 expectResultContains(new String[] {"Jon Doe", "+1 650-253-0000", "jon.do
e@google.com"}); | 100 expectResultContains(new String[] {"Jon Doe", "+16502530000", "jon.doe@g
oogle.com"}); |
| 101 } | 101 } |
| 102 } | 102 } |
| OLD | NEW |