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

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

Issue 145553009: rAc: use libaddressinput to validate international addresses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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
« no previous file with comments | « chrome/browser/ui/autofill/data_model_wrapper.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 EXPECT_EQ(national_formatted, 225 EXPECT_EQ(national_formatted,
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 TEST(FieldMapWrapperTest, BothShippingAndBillingCanCoexist) {
236 DetailInputs inputs;
237
238 DetailInput billing_street;
239 billing_street.type = ADDRESS_BILLING_STREET_ADDRESS;
240 inputs.push_back(billing_street);
241
242 DetailInput shipping_street;
243 shipping_street.type = ADDRESS_HOME_STREET_ADDRESS;
244 inputs.push_back(shipping_street);
245
246 FieldValueMap outputs;
247 outputs[inputs[0].type] = ASCIIToUTF16("123 billing street");
248 outputs[inputs[1].type] = ASCIIToUTF16("123 shipping street");
249
250 FieldMapWrapper wrapper(outputs);
251 wrapper.FillInputs(&inputs);
252
253 EXPECT_NE(inputs[0].initial_value, inputs[1].initial_value);
254 }
255
256 } // namespace autofill 235 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/data_model_wrapper.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698