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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
| 7 #include <memory> |
7 #include <string> | 8 #include <string> |
8 | 9 |
9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/rand_util.h" | 13 #include "base/rand_util.h" |
14 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/string_split.h" | 17 #include "base/strings/string_split.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 21 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 const FormMap& data, | 173 const FormMap& data, |
174 const std::string& submit_js, | 174 const std::string& submit_js, |
175 bool simulate_click, | 175 bool simulate_click, |
176 bool expect_personal_data_change) { | 176 bool expect_personal_data_change) { |
177 GURL url = embedded_test_server()->GetURL("/autofill/" + filename); | 177 GURL url = embedded_test_server()->GetURL("/autofill/" + filename); |
178 chrome::NavigateParams params(browser(), url, | 178 chrome::NavigateParams params(browser(), url, |
179 ui::PAGE_TRANSITION_LINK); | 179 ui::PAGE_TRANSITION_LINK); |
180 params.disposition = NEW_FOREGROUND_TAB; | 180 params.disposition = NEW_FOREGROUND_TAB; |
181 ui_test_utils::NavigateToURL(¶ms); | 181 ui_test_utils::NavigateToURL(¶ms); |
182 | 182 |
183 scoped_ptr<WindowedPersonalDataManagerObserver> observer; | 183 std::unique_ptr<WindowedPersonalDataManagerObserver> observer; |
184 if (expect_personal_data_change) | 184 if (expect_personal_data_change) |
185 observer.reset(new WindowedPersonalDataManagerObserver(browser())); | 185 observer.reset(new WindowedPersonalDataManagerObserver(browser())); |
186 | 186 |
187 std::string js = GetJSToFillForm(data) + submit_js; | 187 std::string js = GetJSToFillForm(data) + submit_js; |
188 ASSERT_TRUE(content::ExecuteScript(render_view_host(), js)); | 188 ASSERT_TRUE(content::ExecuteScript(render_view_host(), js)); |
189 if (simulate_click) { | 189 if (simulate_click) { |
190 // Simulate a mouse click to submit the form because form submissions not | 190 // Simulate a mouse click to submit the form because form submissions not |
191 // triggered by user gestures are ignored. | 191 // triggered by user gestures are ignored. |
192 content::SimulateMouseClick( | 192 content::SimulateMouseClick( |
193 browser()->tab_strip_model()->GetActiveWebContents(), 0, | 193 browser()->tab_strip_model()->GetActiveWebContents(), 0, |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 IN_PROC_BROWSER_TEST_F(AutofillTest, | 805 IN_PROC_BROWSER_TEST_F(AutofillTest, |
806 DISABLED_MergeAggregatedDuplicatedProfiles) { | 806 DISABLED_MergeAggregatedDuplicatedProfiles) { |
807 int num_of_profiles = | 807 int num_of_profiles = |
808 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); | 808 AggregateProfilesIntoAutofillPrefs("dataset_duplicated_profiles.txt"); |
809 | 809 |
810 ASSERT_GT(num_of_profiles, | 810 ASSERT_GT(num_of_profiles, |
811 static_cast<int>(personal_data_manager()->GetProfiles().size())); | 811 static_cast<int>(personal_data_manager()->GetProfiles().size())); |
812 } | 812 } |
813 | 813 |
814 } // namespace autofill | 814 } // namespace autofill |
OLD | NEW |