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/format_macros.h" | 5 #include "base/format_macros.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "components/autofill/core/browser/autofill_field.h" | 9 #include "components/autofill/core/browser/autofill_field.h" |
10 #include "components/autofill/core/browser/autofill_type.h" | 10 #include "components/autofill/core/browser/autofill_type.h" |
11 #include "components/autofill/core/browser/field_types.h" | 11 #include "components/autofill/core/browser/field_types.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
| 14 using base::ASCIIToUTF16; |
| 15 |
14 namespace autofill { | 16 namespace autofill { |
15 namespace { | 17 namespace { |
16 | 18 |
17 // Returns a FormFieldData object corresponding to a <select> field populated | 19 // Returns a FormFieldData object corresponding to a <select> field populated |
18 // with the given |options|. | 20 // with the given |options|. |
19 FormFieldData GenerateSelectFieldWithOptions(const char* const* options, | 21 FormFieldData GenerateSelectFieldWithOptions(const char* const* options, |
20 size_t options_size) { | 22 size_t options_size) { |
21 std::vector<base::string16> options16(options_size); | 23 std::vector<base::string16> options16(options_size); |
22 for (size_t i = 0; i < options_size; ++i) { | 24 for (size_t i = 0; i < options_size; ++i) { |
23 options16[i] = ASCIIToUTF16(options[i]); | 25 options16[i] = ASCIIToUTF16(options[i]); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 field.set_server_type(ADDRESS_HOME_STREET_ADDRESS); | 367 field.set_server_type(ADDRESS_HOME_STREET_ADDRESS); |
366 | 368 |
367 base::string16 value = ASCIIToUTF16("123 Fake St.\n" | 369 base::string16 value = ASCIIToUTF16("123 Fake St.\n" |
368 "Apt. 42"); | 370 "Apt. 42"); |
369 AutofillField::FillFormField(field, value, "en-US", &field); | 371 AutofillField::FillFormField(field, value, "en-US", &field); |
370 EXPECT_EQ(ASCIIToUTF16("123 Fake St., Apt. 42"), field.value); | 372 EXPECT_EQ(ASCIIToUTF16("123 Fake St., Apt. 42"), field.value); |
371 } | 373 } |
372 | 374 |
373 } // namespace | 375 } // namespace |
374 } // namespace autofill | 376 } // namespace autofill |
OLD | NEW |