| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 streets.push_back("St"); | 1016 streets.push_back("St"); |
| 1017 streets.push_back("Ave"); | 1017 streets.push_back("Ave"); |
| 1018 streets.push_back("Ln"); | 1018 streets.push_back("Ln"); |
| 1019 streets.push_back("Ct"); | 1019 streets.push_back("Ct"); |
| 1020 | 1020 |
| 1021 const int kNumProfiles = 1500; | 1021 const int kNumProfiles = 1500; |
| 1022 base::Time start_time = base::Time::Now(); | 1022 base::Time start_time = base::Time::Now(); |
| 1023 std::vector<AutofillProfile> profiles; | 1023 std::vector<AutofillProfile> profiles; |
| 1024 for (int i = 0; i < kNumProfiles; i++) { | 1024 for (int i = 0; i < kNumProfiles; i++) { |
| 1025 AutofillProfile profile; | 1025 AutofillProfile profile; |
| 1026 string16 name(base::IntToString16(i)); | 1026 base::string16 name(base::IntToString16(i)); |
| 1027 string16 email(name + ASCIIToUTF16("@example.com")); | 1027 base::string16 email(name + ASCIIToUTF16("@example.com")); |
| 1028 string16 street = ASCIIToUTF16( | 1028 base::string16 street = ASCIIToUTF16( |
| 1029 base::IntToString(base::RandInt(0, 10000)) + " " + | 1029 base::IntToString(base::RandInt(0, 10000)) + " " + |
| 1030 streets[base::RandInt(0, streets.size() - 1)]); | 1030 streets[base::RandInt(0, streets.size() - 1)]); |
| 1031 string16 city = ASCIIToUTF16(cities[base::RandInt(0, cities.size() - 1)]); | 1031 base::string16 city = ASCIIToUTF16(cities[base::RandInt(0, cities.size() - 1
)]); |
| 1032 string16 zip(base::IntToString16(base::RandInt(0, 10000))); | 1032 base::string16 zip(base::IntToString16(base::RandInt(0, 10000))); |
| 1033 profile.SetRawInfo(NAME_FIRST, name); | 1033 profile.SetRawInfo(NAME_FIRST, name); |
| 1034 profile.SetRawInfo(EMAIL_ADDRESS, email); | 1034 profile.SetRawInfo(EMAIL_ADDRESS, email); |
| 1035 profile.SetRawInfo(ADDRESS_HOME_LINE1, street); | 1035 profile.SetRawInfo(ADDRESS_HOME_LINE1, street); |
| 1036 profile.SetRawInfo(ADDRESS_HOME_CITY, city); | 1036 profile.SetRawInfo(ADDRESS_HOME_CITY, city); |
| 1037 profile.SetRawInfo(ADDRESS_HOME_STATE, WideToUTF16(L"CA")); | 1037 profile.SetRawInfo(ADDRESS_HOME_STATE, WideToUTF16(L"CA")); |
| 1038 profile.SetRawInfo(ADDRESS_HOME_ZIP, zip); | 1038 profile.SetRawInfo(ADDRESS_HOME_ZIP, zip); |
| 1039 profile.SetRawInfo(ADDRESS_HOME_COUNTRY, WideToUTF16(L"US")); | 1039 profile.SetRawInfo(ADDRESS_HOME_COUNTRY, WideToUTF16(L"US")); |
| 1040 profiles.push_back(profile); | 1040 profiles.push_back(profile); |
| 1041 } | 1041 } |
| 1042 SetProfiles(&profiles); | 1042 SetProfiles(&profiles); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 ASSERT_TRUE(content::ExecuteScript( | 1083 ASSERT_TRUE(content::ExecuteScript( |
| 1084 GetRenderViewHost(), | 1084 GetRenderViewHost(), |
| 1085 "document.querySelector('input').autocomplete = 'off';")); | 1085 "document.querySelector('input').autocomplete = 'off';")); |
| 1086 | 1086 |
| 1087 // Press the down arrow to select the suggestion and attempt to preview the | 1087 // Press the down arrow to select the suggestion and attempt to preview the |
| 1088 // autofilled form. | 1088 // autofilled form. |
| 1089 SendKeyToPopupAndWait(ui::VKEY_DOWN); | 1089 SendKeyToPopupAndWait(ui::VKEY_DOWN); |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 } // namespace autofill | 1092 } // namespace autofill |
| OLD | NEW |