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

Unified Diff: trunk/src/components/autofill/core/browser/phone_number_unittest.cc

Issue 383123011: Revert 282761 "Change PhoneNumber::SetInfo to only apply formatt..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 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 | « trunk/src/components/autofill/core/browser/phone_number_i18n_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/components/autofill/core/browser/phone_number_unittest.cc
===================================================================
--- trunk/src/components/autofill/core/browser/phone_number_unittest.cc (revision 282777)
+++ trunk/src/components/autofill/core/browser/phone_number_unittest.cc (working copy)
@@ -104,23 +104,13 @@
ASCIIToUTF16("8887776666"), "US"));
EXPECT_EQ(ASCIIToUTF16("(888) 777-6666"),
phone.GetRawInfo(PHONE_HOME_WHOLE_NUMBER));
- EXPECT_TRUE(phone.SetInfo(AutofillType(PHONE_HOME_WHOLE_NUMBER),
- ASCIIToUTF16("+18887776666"),
- "US"));
- EXPECT_EQ(ASCIIToUTF16("+1 888-777-6666"),
- phone.GetRawInfo(PHONE_HOME_WHOLE_NUMBER));
- // Differently formatted numbers should be left alone.
+ // Differently formatted numbers should be re-formatted.
EXPECT_TRUE(phone.SetInfo(AutofillType(PHONE_HOME_WHOLE_NUMBER),
ASCIIToUTF16("800-432-8765"), "US"));
- EXPECT_EQ(ASCIIToUTF16("800-432-8765"),
+ EXPECT_EQ(ASCIIToUTF16("(800) 432-8765"),
phone.GetRawInfo(PHONE_HOME_WHOLE_NUMBER));
- // SetRawInfo should not try to format.
- phone.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, ASCIIToUTF16("8004328765"));
- EXPECT_EQ(ASCIIToUTF16("8004328765"),
- phone.GetRawInfo(PHONE_HOME_WHOLE_NUMBER));
-
// Invalid numbers should not be stored. In the US, phone numbers cannot
// start with the digit '1'.
EXPECT_FALSE(phone.SetInfo(AutofillType(PHONE_HOME_WHOLE_NUMBER),
« no previous file with comments | « trunk/src/components/autofill/core/browser/phone_number_i18n_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698