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 ...@@ -225,6 +225,7 @@ public class EditorView extends AlwaysDismissedDialog
new Runnable() { new Runnable() {
@Override @Override
public void run() { public void run() {
removeTextChangedListenerFromPhoneInputField();
// Do not remove the "* indicates required field" label at the // Do not remove the "* indicates required field" label at the
// bottom. // bottom.
dataView.removeViews(0, dataView.getChildCount() - 1); dataView.removeViews(0, dataView.getChildCount() - 1);
...@@ -283,11 +284,16 @@ public class EditorView extends AlwaysDismissedDialog ...@@ -283,11 +284,16 @@ public class EditorView extends AlwaysDismissedDialog
@Override @Override
public void onDismiss(DialogInterface dialog) { public void onDismiss(DialogInterface dialog) {
if (mPhoneInput != null) mPhoneInput.removeTextChangedListener(getPhoneFormatter()); removeTextChangedListenerFromPhoneInputField();
mEditorModel.cancel(); mEditorModel.cancel();
if (mObserverForTest != null) mObserverForTest.onPaymentRequestEditorDismissed(); 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. */ /** Immediately returns the phone formatter or null if it has not initialized yet. */
private PhoneNumberFormattingTextWatcher getPhoneFormatter() { private PhoneNumberFormattingTextWatcher getPhoneFormatter() {
try { try {
......
...@@ -7,7 +7,6 @@ package org.chromium.chrome.browser.payments; ...@@ -7,7 +7,6 @@ package org.chromium.chrome.browser.payments;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper; import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
...@@ -81,7 +80,6 @@ public class PaymentRequestFreeShippingTest extends PaymentRequestTestBase { ...@@ -81,7 +80,6 @@ public class PaymentRequestFreeShippingTest extends PaymentRequestTestBase {
} }
/** Change the country in the spinner, add a valid address, and complete the transaction. */ /** Change the country in the spinner, add a valid address, and complete the transaction. */
@DisabledTest // https://crbug.com/624653
@MediumTest @MediumTest
public void testChangeCountryAddAddressAndPay() public void testChangeCountryAddAddressAndPay()
throws InterruptedException, ExecutionException, TimeoutException { throws InterruptedException, ExecutionException, TimeoutException {
......
...@@ -7,7 +7,6 @@ package org.chromium.chrome.browser.payments; ...@@ -7,7 +7,6 @@ package org.chromium.chrome.browser.payments;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.chrome.R; import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper; import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
...@@ -41,10 +40,7 @@ public class PaymentRequestIncompleteContactDetailsTest extends PaymentRequestTe ...@@ -41,10 +40,7 @@ public class PaymentRequestIncompleteContactDetailsTest extends PaymentRequestTe
} }
/** Attempt to update the contact information with invalid data and cancel the transaction. */ /** Attempt to update the contact information with invalid data and cancel the transaction. */
/*
@MediumTest @MediumTest
*/
@DisabledTest(message = "crbug.com/623244")
public void testEditIncompleteContactAndCancel() public void testEditIncompleteContactAndCancel()
throws InterruptedException, ExecutionException, TimeoutException { throws InterruptedException, ExecutionException, TimeoutException {
triggerUIAndWait(mReadyForInput); 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