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

Unified Diff: chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc

Issue 2905283002: [Payments] Allow international phone from different country in shipping editor. (Closed)
Patch Set: Created 3 years, 7 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
Index: chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc
diff --git a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc
index 4b8edd22de409bf01e37a1f29903844611d7eb16..8f8095f2a8292de207d5db63cbc1c2f44e303585 100644
--- a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc
+++ b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc
@@ -599,4 +599,36 @@ IN_PROC_BROWSER_TEST_F(PaymentRequestShippingAddressEditorTest,
EXPECT_NE(textfield->GetFocusManager()->GetFocusedView(), nullptr);
}
+// Tests that the editor accepts an international phone from another country.
+IN_PROC_BROWSER_TEST_F(PaymentRequestShippingAddressEditorTest,
+ InternationalPhoneNumberFromOtherCountry) {
+ InvokePaymentRequestUI();
+ OpenShippingAddressEditorScreen();
+
+ SetCommonFields();
+
+ // Set an Australian phone number in international format.
+ SetEditorTextfieldValue(base::UTF8ToUTF16("+61 2 9374 4000"),
+ autofill::PHONE_HOME_WHOLE_NUMBER);
+
+ ResetEventObserver(DialogEvent::BACK_TO_PAYMENT_SHEET_NAVIGATION);
+ ClickOnDialogViewAndWait(DialogViewID::SAVE_ADDRESS_BUTTON);
+}
+
+// Tests that the editor doesn't accept a local phone from another country.
+IN_PROC_BROWSER_TEST_F(PaymentRequestShippingAddressEditorTest,
+ LocalPhoneNumberFromOtherCountry) {
+ InvokePaymentRequestUI();
+ OpenShippingAddressEditorScreen();
+
+ SetCommonFields();
+
+ // Set an Australian phone number in international format.
+ SetEditorTextfieldValue(base::UTF8ToUTF16("02 9374 4000"),
+ autofill::PHONE_HOME_WHOLE_NUMBER);
+
+ ResetEventObserver(DialogEvent::EDITOR_VALIDATION_ERROR);
Mathieu 2017/05/29 16:34:00 we are disabling the done button when there is inv
sebsg 2017/05/29 19:48:39 Ok, I'll rebase when it lands.
+ ClickOnDialogViewAndWait(DialogViewID::SAVE_ADDRESS_BUTTON);
+}
+
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698