| 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
| 9 #include "chrome/browser/ui/autofill/data_model_wrapper.h" | 9 #include "chrome/browser/ui/autofill/data_model_wrapper.h" |
| 10 #include "components/autofill/content/browser/wallet/wallet_items.h" | 10 #include "components/autofill/content/browser/wallet/wallet_items.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 EXPECT_EQ(national_formatted, | 163 EXPECT_EQ(national_formatted, |
| 164 profile_wrapper.GetInfoForDisplay( | 164 profile_wrapper.GetInfoForDisplay( |
| 165 AutofillType(PHONE_HOME_WHOLE_NUMBER))); | 165 AutofillType(PHONE_HOME_WHOLE_NUMBER))); |
| 166 profile.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, user_formatted); | 166 profile.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, user_formatted); |
| 167 EXPECT_EQ(user_formatted, | 167 EXPECT_EQ(user_formatted, |
| 168 profile_wrapper.GetInfoForDisplay( | 168 profile_wrapper.GetInfoForDisplay( |
| 169 AutofillType(PHONE_HOME_WHOLE_NUMBER))); | 169 AutofillType(PHONE_HOME_WHOLE_NUMBER))); |
| 170 | 170 |
| 171 } | 171 } |
| 172 | 172 |
| 173 TEST(FieldMapWrapperTest, BothShippingAndBillingCanCoexist) { | |
| 174 DetailInputs inputs; | |
| 175 | |
| 176 DetailInput billing_street; | |
| 177 billing_street.type = ADDRESS_BILLING_STREET_ADDRESS; | |
| 178 inputs.push_back(billing_street); | |
| 179 | |
| 180 DetailInput shipping_street; | |
| 181 shipping_street.type = ADDRESS_HOME_STREET_ADDRESS; | |
| 182 inputs.push_back(shipping_street); | |
| 183 | |
| 184 FieldValueMap outputs; | |
| 185 outputs[inputs[0].type] = ASCIIToUTF16("123 billing street"); | |
| 186 outputs[inputs[1].type] = ASCIIToUTF16("123 shipping street"); | |
| 187 | |
| 188 FieldMapWrapper wrapper(outputs); | |
| 189 wrapper.FillInputs(&inputs); | |
| 190 | |
| 191 EXPECT_NE(inputs[0].initial_value, inputs[1].initial_value); | |
| 192 } | |
| 193 | |
| 194 } // namespace autofill | 173 } // namespace autofill |
| OLD | NEW |