| 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 ui_test_utils::NavigateToURL(browser(), url); | 172 chrome::NavigateParams params(browser(), url, |
| 173 content::PAGE_TRANSITION_LINK); |
| 174 params.disposition = NEW_FOREGROUND_TAB; |
| 175 ui_test_utils::NavigateToURL(¶ms); |
| 173 | 176 |
| 174 std::string js; | 177 std::string js; |
| 175 for (FormMap::const_iterator i = data.begin(); i != data.end(); ++i) { | 178 for (FormMap::const_iterator i = data.begin(); i != data.end(); ++i) { |
| 176 js += "document.getElementById('" + i->first + "').value = '" + | 179 js += "document.getElementById('" + i->first + "').value = '" + |
| 177 i->second + "';"; | 180 i->second + "';"; |
| 178 } | 181 } |
| 179 js += "document.onclick = function() {" | 182 js += "document.onclick = function() {" |
| 180 " document.getElementById('testform').submit();" | 183 " document.getElementById('testform').submit();" |
| 181 "};"; | 184 "};"; |
| 182 | 185 |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 IN_PROC_BROWSER_TEST_F(AutofillTest, | 732 IN_PROC_BROWSER_TEST_F(AutofillTest, |
| 730 DISABLED_MergeAggregatedDuplicatedProfiles) { | 733 DISABLED_MergeAggregatedDuplicatedProfiles) { |
| 731 int num_of_profiles = | 734 int num_of_profiles = |
| 732 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); | 735 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); |
| 733 | 736 |
| 734 ASSERT_GT(num_of_profiles, | 737 ASSERT_GT(num_of_profiles, |
| 735 static_cast<int>(personal_data_manager()->GetProfiles().size())); | 738 static_cast<int>(personal_data_manager()->GetProfiles().size())); |
| 736 } | 739 } |
| 737 | 740 |
| 738 } // namespace autofill | 741 } // namespace autofill |
| OLD | NEW |