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 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 SendKeyToPageAndWait(ui::VKEY_M); | 1663 SendKeyToPageAndWait(ui::VKEY_M); |
1664 | 1664 |
1665 // Now that the popup with suggestions is showing, disable autocomplete for | 1665 // Now that the popup with suggestions is showing, disable autocomplete for |
1666 // the active field. | 1666 // the active field. |
1667 ASSERT_TRUE(content::ExecuteScript( | 1667 ASSERT_TRUE(content::ExecuteScript( |
1668 render_view_host(), | 1668 render_view_host(), |
1669 "document.querySelector('input').autocomplete = 'off';")); | 1669 "document.querySelector('input').autocomplete = 'off';")); |
1670 | 1670 |
1671 // Press the down arrow to select the suggestion and attempt to preview the | 1671 // Press the down arrow to select the suggestion and attempt to preview the |
1672 // autofilled form. | 1672 // autofilled form. |
1673 if (!external_delegate()) { | 1673 content::NativeWebKeyboardEvent event; |
1674 content::SimulateKeyPress( | 1674 event.windowsKeyCode = ui::VKEY_DOWN; |
1675 browser()->tab_strip_model()->GetActiveWebContents(), | 1675 external_delegate()->keyboard_listener()->HandleKeyPressEvent(event); |
1676 ui::VKEY_DOWN, false, false, false, false); | |
1677 } else { | |
1678 content::NativeWebKeyboardEvent event; | |
1679 event.windowsKeyCode = ui::VKEY_DOWN; | |
1680 external_delegate()->keyboard_listener()->HandleKeyPressEvent(event); | |
1681 } | |
1682 | 1676 |
1683 // Wait for any IPCs to complete by performing an action that generates an | 1677 // Wait for any IPCs to complete by performing an action that generates an |
1684 // IPC that's easy to wait for. Chrome shouldn't crash. | 1678 // IPC that's easy to wait for. Chrome shouldn't crash. |
1685 bool result = false; | 1679 bool result = false; |
1686 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 1680 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
1687 render_view_host(), | 1681 render_view_host(), |
1688 "var city = document.getElementById('city');" | 1682 "var city = document.getElementById('city');" |
1689 "city.onfocus = function() { domAutomationController.send(true); };" | 1683 "city.onfocus = function() { domAutomationController.send(true); };" |
1690 "city.focus()", | 1684 "city.focus()", |
1691 &result)); | 1685 &result)); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 IN_PROC_BROWSER_TEST_F(AutofillTest, | 1718 IN_PROC_BROWSER_TEST_F(AutofillTest, |
1725 DISABLED_MergeAggregatedDuplicatedProfiles) { | 1719 DISABLED_MergeAggregatedDuplicatedProfiles) { |
1726 int num_of_profiles = | 1720 int num_of_profiles = |
1727 AggregateProfilesIntoAutofillPrefs("dataset_no_address.txt"); | 1721 AggregateProfilesIntoAutofillPrefs("dataset_no_address.txt"); |
1728 | 1722 |
1729 ASSERT_GT(num_of_profiles, | 1723 ASSERT_GT(num_of_profiles, |
1730 static_cast<int>(personal_data_manager()->GetProfiles().size())); | 1724 static_cast<int>(personal_data_manager()->GetProfiles().size())); |
1731 } | 1725 } |
1732 | 1726 |
1733 } // namespace autofill | 1727 } // namespace autofill |
OLD | NEW |