| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 std::vector<CreditCard> cards; | 155 std::vector<CreditCard> cards; |
| 156 cards.push_back(card); | 156 cards.push_back(card); |
| 157 SetCards(&cards); | 157 SetCards(&cards); |
| 158 } | 158 } |
| 159 | 159 |
| 160 typedef std::map<std::string, std::string> FormMap; | 160 typedef std::map<std::string, std::string> FormMap; |
| 161 // Navigate to the form, input values into the fields, and submit the form. | 161 // Navigate to the form, input values into the fields, and submit the form. |
| 162 // The function returns after the PersonalDataManager is updated. | 162 // The function returns after the PersonalDataManager is updated. |
| 163 void FillFormAndSubmit(const std::string& filename, const FormMap& data) { | 163 void FillFormAndSubmit(const std::string& filename, const FormMap& data) { |
| 164 GURL url = test_server()->GetURL("files/autofill/" + filename); | 164 GURL url = test_server()->GetURL("files/autofill/" + filename); |
| 165 ui_test_utils::NavigateToURL(browser(), url); | 165 chrome::NavigateParams params(browser(), url, |
| 166 content::PAGE_TRANSITION_LINK); |
| 167 params.disposition = NEW_FOREGROUND_TAB; |
| 168 ui_test_utils::NavigateToURL(¶ms); |
| 166 | 169 |
| 167 std::string js; | 170 std::string js; |
| 168 for (FormMap::const_iterator i = data.begin(); i != data.end(); ++i) { | 171 for (FormMap::const_iterator i = data.begin(); i != data.end(); ++i) { |
| 169 js += "document.getElementById('" + i->first + "').value = '" + | 172 js += "document.getElementById('" + i->first + "').value = '" + |
| 170 i->second + "';"; | 173 i->second + "';"; |
| 171 } | 174 } |
| 172 js += "document.onclick = function() {" | 175 js += "document.onclick = function() {" |
| 173 " document.getElementById('testform').submit();" | 176 " document.getElementById('testform').submit();" |
| 174 "};"; | 177 "};"; |
| 175 | 178 |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 IN_PROC_BROWSER_TEST_F(AutofillTest, | 725 IN_PROC_BROWSER_TEST_F(AutofillTest, |
| 723 DISABLED_MergeAggregatedDuplicatedProfiles) { | 726 DISABLED_MergeAggregatedDuplicatedProfiles) { |
| 724 int num_of_profiles = | 727 int num_of_profiles = |
| 725 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); | 728 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); |
| 726 | 729 |
| 727 ASSERT_GT(num_of_profiles, | 730 ASSERT_GT(num_of_profiles, |
| 728 static_cast<int>(personal_data_manager()->GetProfiles().size())); | 731 static_cast<int>(personal_data_manager()->GetProfiles().size())); |
| 729 } | 732 } |
| 730 | 733 |
| 731 } // namespace autofill | 734 } // namespace autofill |
| OLD | NEW |