| 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/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 cards.push_back(card); | 157 cards.push_back(card); |
| 158 SetCards(&cards); | 158 SetCards(&cards); |
| 159 } | 159 } |
| 160 | 160 |
| 161 typedef std::map<std::string, std::string> FormMap; | 161 typedef std::map<std::string, std::string> FormMap; |
| 162 // Navigate to the form, input values into the fields, and submit the form. | 162 // Navigate to the form, input values into the fields, and submit the form. |
| 163 // The function returns after the PersonalDataManager is updated. | 163 // The function returns after the PersonalDataManager is updated. |
| 164 void FillFormAndSubmit(const std::string& filename, const FormMap& data) { | 164 void FillFormAndSubmit(const std::string& filename, const FormMap& data) { |
| 165 GURL url = test_server()->GetURL("files/autofill/" + filename); | 165 GURL url = test_server()->GetURL("files/autofill/" + filename); |
| 166 chrome::NavigateParams params(browser(), url, | 166 chrome::NavigateParams params(browser(), url, |
| 167 content::PAGE_TRANSITION_LINK); | 167 ui::PAGE_TRANSITION_LINK); |
| 168 params.disposition = NEW_FOREGROUND_TAB; | 168 params.disposition = NEW_FOREGROUND_TAB; |
| 169 ui_test_utils::NavigateToURL(¶ms); | 169 ui_test_utils::NavigateToURL(¶ms); |
| 170 | 170 |
| 171 std::string js; | 171 std::string js; |
| 172 for (FormMap::const_iterator i = data.begin(); i != data.end(); ++i) { | 172 for (FormMap::const_iterator i = data.begin(); i != data.end(); ++i) { |
| 173 js += "document.getElementById('" + i->first + "').value = '" + | 173 js += "document.getElementById('" + i->first + "').value = '" + |
| 174 i->second + "';"; | 174 i->second + "';"; |
| 175 } | 175 } |
| 176 js += "document.onclick = function() {" | 176 js += "document.onclick = function() {" |
| 177 " document.getElementById('testform').submit();" | 177 " document.getElementById('testform').submit();" |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 IN_PROC_BROWSER_TEST_F(AutofillTest, | 834 IN_PROC_BROWSER_TEST_F(AutofillTest, |
| 835 DISABLED_MergeAggregatedDuplicatedProfiles) { | 835 DISABLED_MergeAggregatedDuplicatedProfiles) { |
| 836 int num_of_profiles = | 836 int num_of_profiles = |
| 837 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); | 837 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); |
| 838 | 838 |
| 839 ASSERT_GT(num_of_profiles, | 839 ASSERT_GT(num_of_profiles, |
| 840 static_cast<int>(personal_data_manager()->GetProfiles().size())); | 840 static_cast<int>(personal_data_manager()->GetProfiles().size())); |
| 841 } | 841 } |
| 842 | 842 |
| 843 } // namespace autofill | 843 } // namespace autofill |
| OLD | NEW |