| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 } | 356 } |
| 357 | 357 |
| 358 bool HandleKeyPressEvent(const content::NativeWebKeyboardEvent& event) { | 358 bool HandleKeyPressEvent(const content::NativeWebKeyboardEvent& event) { |
| 359 return true; | 359 return true; |
| 360 } | 360 } |
| 361 | 361 |
| 362 void SendKeyToPopupAndWait(ui::KeyboardCode key) { | 362 void SendKeyToPopupAndWait(ui::KeyboardCode key) { |
| 363 // Route popup-targeted key presses via the render view host. | 363 // Route popup-targeted key presses via the render view host. |
| 364 content::NativeWebKeyboardEvent event; | 364 content::NativeWebKeyboardEvent event; |
| 365 event.windowsKeyCode = key; | 365 event.windowsKeyCode = key; |
| 366 event.type = WebKit::WebKeyboardEvent::RawKeyDown; | 366 event.type = blink::WebKeyboardEvent::RawKeyDown; |
| 367 test_delegate_.Reset(); | 367 test_delegate_.Reset(); |
| 368 // Install the key press event sink to ensure that any events that are not | 368 // Install the key press event sink to ensure that any events that are not |
| 369 // handled by the installed callbacks do not end up crashing the test. | 369 // handled by the installed callbacks do not end up crashing the test. |
| 370 GetRenderViewHost()->AddKeyPressEventCallback(key_press_event_sink_); | 370 GetRenderViewHost()->AddKeyPressEventCallback(key_press_event_sink_); |
| 371 GetRenderViewHost()->ForwardKeyboardEvent(event); | 371 GetRenderViewHost()->ForwardKeyboardEvent(event); |
| 372 test_delegate_.Wait(); | 372 test_delegate_.Wait(); |
| 373 GetRenderViewHost()->RemoveKeyPressEventCallback(key_press_event_sink_); | 373 GetRenderViewHost()->RemoveKeyPressEventCallback(key_press_event_sink_); |
| 374 } | 374 } |
| 375 | 375 |
| 376 void TryBasicFormFill() { | 376 void TryBasicFormFill() { |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 ASSERT_TRUE(content::ExecuteScript( | 1083 ASSERT_TRUE(content::ExecuteScript( |
| 1084 GetRenderViewHost(), | 1084 GetRenderViewHost(), |
| 1085 "document.querySelector('input').autocomplete = 'off';")); | 1085 "document.querySelector('input').autocomplete = 'off';")); |
| 1086 | 1086 |
| 1087 // Press the down arrow to select the suggestion and attempt to preview the | 1087 // Press the down arrow to select the suggestion and attempt to preview the |
| 1088 // autofilled form. | 1088 // autofilled form. |
| 1089 SendKeyToPopupAndWait(ui::VKEY_DOWN); | 1089 SendKeyToPopupAndWait(ui::VKEY_DOWN); |
| 1090 } | 1090 } |
| 1091 | 1091 |
| 1092 } // namespace autofill | 1092 } // namespace autofill |
| OLD | NEW |