Chromium Code Reviews| Index: chrome/test/data/webui/inline_editable_list_test.html |
| diff --git a/chrome/test/data/webui/inline_editable_list_test.html b/chrome/test/data/webui/inline_editable_list_test.html |
| index 39e63d500a6bd210abcd0a66ce30b0f1a568feee..94b54ad4c5af0c79fbf8299075219991b985ff5d 100644 |
| --- a/chrome/test/data/webui/inline_editable_list_test.html |
| +++ b/chrome/test/data/webui/inline_editable_list_test.html |
| @@ -108,12 +108,10 @@ function setUp() { |
| /** |
| * @param {!EventTarget} target Where to send the event. |
| - * @param {!string} keyIdentifier Which key to send. |
| + * @param {!string} key Which key to send. |
| */ |
| -function sendKeyDownEvent(target, keyIdentifier) { |
| - var event = document.createEvent('KeyboardEvent'); |
| - event.initKeyboardEvent('keydown', true, true, window, keyIdentifier); |
| - assertEquals(keyIdentifier, event.keyIdentifier); |
| +function sendKeyDownEvent(target, key) { |
| + var event = new KeyboardEvent('keydown', {bubbles: true, cancelable: true, key: key}); |
|
Dan Beam
2016/06/29 23:34:17
this should wrap at 80 cols
dtapuska
2016/06/30 14:16:50
Done.
|
| target.dispatchEvent(event); |
| } |
| @@ -135,15 +133,15 @@ function testUpDownFocus() { |
| list.selectionModel.leadIndex = 0; |
| assertTrue(list.hasExactlyOneItemFocusable(0)); |
| - sendKeyDownEvent(list, 'Down'); |
| + sendKeyDownEvent(list, 'ArrowDown'); |
| assertTrue(list.hasExactlyOneItemFocusable(1)); |
| - sendKeyDownEvent(list, 'Down'); |
| + sendKeyDownEvent(list, 'ArrowDown'); |
| assertTrue(list.hasExactlyOneItemFocusable(2)); |
| - sendKeyDownEvent(list, 'Up'); |
| + sendKeyDownEvent(list, 'ArrowUp'); |
| assertTrue(list.hasExactlyOneItemFocusable(1)); |
| - sendKeyDownEvent(list, 'Up'); |
| + sendKeyDownEvent(list, 'ArrowUp'); |
| assertTrue(list.hasExactlyOneItemFocusable(0)); |
| - sendKeyDownEvent(list, 'Down'); |
| + sendKeyDownEvent(list, 'ArrowDown'); |
| assertTrue(list.hasExactlyOneItemFocusable(1)); |
| } |