OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 std::vector<CreditCard> cards; | 162 std::vector<CreditCard> cards; |
163 cards.push_back(card); | 163 cards.push_back(card); |
164 SetCards(&cards); | 164 SetCards(&cards); |
165 } | 165 } |
166 | 166 |
167 typedef std::map<std::string, std::string> FormMap; | 167 typedef std::map<std::string, std::string> FormMap; |
168 // Navigate to the form, input values into the fields, and submit the form. | 168 // Navigate to the form, input values into the fields, and submit the form. |
169 // The function returns after the PersonalDataManager is updated. | 169 // The function returns after the PersonalDataManager is updated. |
170 void FillFormAndSubmit(const std::string& filename, const FormMap& data) { | 170 void FillFormAndSubmit(const std::string& filename, const FormMap& data) { |
171 GURL url = test_server()->GetURL("files/autofill/" + filename); | 171 GURL url = test_server()->GetURL("files/autofill/" + filename); |
172 chrome::NavigateParams params(browser(), url, | 172 ui_test_utils::NavigateToURL(browser(), url); |
173 content::PAGE_TRANSITION_LINK); | |
174 params.disposition = NEW_FOREGROUND_TAB; | |
175 ui_test_utils::NavigateToURL(¶ms); | |
176 | 173 |
177 std::string js; | 174 std::string js; |
178 for (FormMap::const_iterator i = data.begin(); i != data.end(); ++i) { | 175 for (FormMap::const_iterator i = data.begin(); i != data.end(); ++i) { |
179 js += "document.getElementById('" + i->first + "').value = '" + | 176 js += "document.getElementById('" + i->first + "').value = '" + |
180 i->second + "';"; | 177 i->second + "';"; |
181 } | 178 } |
182 js += "document.onclick = function() {" | 179 js += "document.onclick = function() {" |
183 " document.getElementById('testform').submit();" | 180 " document.getElementById('testform').submit();" |
184 "};"; | 181 "};"; |
185 | 182 |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 IN_PROC_BROWSER_TEST_F(AutofillTest, | 729 IN_PROC_BROWSER_TEST_F(AutofillTest, |
733 DISABLED_MergeAggregatedDuplicatedProfiles) { | 730 DISABLED_MergeAggregatedDuplicatedProfiles) { |
734 int num_of_profiles = | 731 int num_of_profiles = |
735 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); | 732 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); |
736 | 733 |
737 ASSERT_GT(num_of_profiles, | 734 ASSERT_GT(num_of_profiles, |
738 static_cast<int>(personal_data_manager()->GetProfiles().size())); | 735 static_cast<int>(personal_data_manager()->GetProfiles().size())); |
739 } | 736 } |
740 | 737 |
741 } // namespace autofill | 738 } // namespace autofill |
OLD | NEW |