OLD | NEW |
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 Loading... |
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 |
OLD | NEW |