Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(848)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java

Issue 2116563002: Fix assert and re-enable tests for PaymentRequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java
index 4e871f2a52d3cd024d5b1328eb9e2a47158e0295..72b617829117135860efed83b064436208c06335 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java
@@ -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 {
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698