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

Side by Side Diff: chrome/browser/ui/autofill/data_model_wrapper_unittest.cc

Issue 298863012: Use upstream libaddressinput in Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Work in progress for suggestions impl. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/guid.h" 5 #include "base/guid.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" 9 #include "chrome/browser/ui/autofill/autofill_dialog_models.h"
10 #include "chrome/browser/ui/autofill/data_model_wrapper.h" 10 #include "chrome/browser/ui/autofill/data_model_wrapper.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 address_wrapper.GetInfo(AutofillType(PHONE_HOME_WHOLE_NUMBER))); 92 address_wrapper.GetInfo(AutofillType(PHONE_HOME_WHOLE_NUMBER)));
93 EXPECT_FALSE(address_wrapper.GetDisplayText(&unused, &unused2)); 93 EXPECT_FALSE(address_wrapper.GetDisplayText(&unused, &unused2));
94 } 94 }
95 95
96 TEST(DataModelWrapperTest, GetDisplayText) { 96 TEST(DataModelWrapperTest, GetDisplayText) {
97 AutofillProfile profile = test::GetFullProfile(); 97 AutofillProfile profile = test::GetFullProfile();
98 base::string16 vertical, horizontal; 98 base::string16 vertical, horizontal;
99 EXPECT_TRUE( 99 EXPECT_TRUE(
100 AutofillProfileWrapper(&profile).GetDisplayText(&horizontal, &vertical)); 100 AutofillProfileWrapper(&profile).GetDisplayText(&horizontal, &vertical));
101 EXPECT_EQ( 101 EXPECT_EQ(
102 ASCIIToUTF16("John H. Doe, 666 Erebus St., Apt 8, Elysium, CA 91111\n" 102 ASCIIToUTF16("John H. Doe, 666 Erebus St., Apt 8, Elysium CA 91111\n"
Evan Stade 2014/06/12 00:18:08 this breaks the test
please use gerrit instead 2014/06/13 19:22:09 Neither https://code.google.com/p/chromium/codesea
Evan Stade 2014/06/13 20:07:08 I believe we've had this discussion before, and yo
103 "johndoe@hades.com\n" 103 "johndoe@hades.com\n"
104 "+1 650-211-1111"), 104 "+1 650-211-1111"),
105 horizontal); 105 horizontal);
106 EXPECT_EQ( 106 EXPECT_EQ(
107 ASCIIToUTF16("John H. Doe\n" 107 ASCIIToUTF16("John H. Doe\n"
108 "666 Erebus St.\n" 108 "666 Erebus St.\n"
109 "Apt 8\n" 109 "Apt 8\n"
110 "Elysium, CA 91111\n" 110 "Elysium CA 91111\n"
Evan Stade 2014/06/12 00:18:08 ditto
111 "johndoe@hades.com\n" 111 "johndoe@hades.com\n"
112 "+1 650-211-1111"), 112 "+1 650-211-1111"),
113 vertical); 113 vertical);
114 114
115 // A Japanese address. 115 // A Japanese address.
116 AutofillProfile foreign_profile( 116 AutofillProfile foreign_profile(
117 base::GenerateGUID(), "http://www.example.com/"); 117 base::GenerateGUID(), "http://www.example.com/");
118 foreign_profile.SetRawInfo( 118 foreign_profile.SetRawInfo(
119 ADDRESS_HOME_COUNTRY, ASCIIToUTF16("JP")); 119 ADDRESS_HOME_COUNTRY, ASCIIToUTF16("JP"));
120 foreign_profile.SetRawInfo( 120 foreign_profile.SetRawInfo(
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 profile_wrapper.GetInfoForDisplay( 226 profile_wrapper.GetInfoForDisplay(
227 AutofillType(PHONE_HOME_WHOLE_NUMBER))); 227 AutofillType(PHONE_HOME_WHOLE_NUMBER)));
228 profile.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, user_formatted); 228 profile.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, user_formatted);
229 EXPECT_EQ(user_formatted, 229 EXPECT_EQ(user_formatted,
230 profile_wrapper.GetInfoForDisplay( 230 profile_wrapper.GetInfoForDisplay(
231 AutofillType(PHONE_HOME_WHOLE_NUMBER))); 231 AutofillType(PHONE_HOME_WHOLE_NUMBER)));
232 232
233 } 233 }
234 234
235 } // namespace autofill 235 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698