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

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

Issue 2910423003: [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
« no previous file with comments | « no previous file | components/payments/core/payment_request_data_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2c0b91678e8c68a9252a580042e79c4ff900f536 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,35 @@ 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);
+
+ EXPECT_TRUE(IsEditorTextfieldInvalid(autofill::PHONE_HOME_WHOLE_NUMBER));
+}
+
} // namespace payments
« no previous file with comments | « no previous file | components/payments/core/payment_request_data_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698