Commit a474a14a authored by rouslan's avatar rouslan Committed by Commit bot

Fix assert and re-enable tests for PaymentRequest.

BUG=624653

Review-Url: https://codereview.chromium.org/2116563002
Cr-Commit-Position: refs/heads/master@{#403217}
parent 1d5b29c8
......@@ -225,6 +225,7 @@ public class EditorView extends AlwaysDismissedDialog
new Runnable() {
@Override
public void run() {
removeTextChangedListenerFromPhoneInputField();
// Do not remove the "* indicates required field" label at the
// bottom.
dataView.removeViews(0, dataView.getChildCount() - 1);
......@@ -283,11 +284,16 @@ public class EditorView extends AlwaysDismissedDialog
@Override
public void onDismiss(DialogInterface dialog) {
if (mPhoneInput != null) mPhoneInput.removeTextChangedListener(getPhoneFormatter());
removeTextChangedListenerFromPhoneInputField();
mEditorModel.cancel();
if (mObserverForTest != null) mObserverForTest.onPaymentRequestEditorDismissed();
}
private void removeTextChangedListenerFromPhoneInputField() {
if (mPhoneInput != null) mPhoneInput.removeTextChangedListener(getPhoneFormatter());
mPhoneInput = null;
}
/** Immediately returns the phone formatter or null if it has not initialized yet. */
private PhoneNumberFormattingTextWatcher getPhoneFormatter() {
try {
......
......@@ -7,7 +7,6 @@ package org.chromium.chrome.browser.payments;
import android.content.DialogInterface;
import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
......@@ -81,7 +80,6 @@ public class PaymentRequestFreeShippingTest extends PaymentRequestTestBase {
}
/** Change the country in the spinner, add a valid address, and complete the transaction. */
@DisabledTest // https://crbug.com/624653
@MediumTest
public void testChangeCountryAddAddressAndPay()
throws InterruptedException, ExecutionException, TimeoutException {
......
......@@ -7,7 +7,6 @@ package org.chromium.chrome.browser.payments;
import android.content.DialogInterface;
import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
......@@ -41,10 +40,7 @@ public class PaymentRequestIncompleteContactDetailsTest extends PaymentRequestTe
}
/** Attempt to update the contact information with invalid data and cancel the transaction. */
/*
@MediumTest
*/
@DisabledTest(message = "crbug.com/623244")
public void testEditIncompleteContactAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
triggerUIAndWait(mReadyForInput);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment