Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9503)

Unified Diff: chrome/test/data/webui/inline_editable_list_test.html

Issue 2104103002: Convert Event#keyIdentifier (deprecated) to Event#key (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
}

Powered by Google App Engine
This is Rietveld 408576698