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

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: Patch file manager test Created 4 years, 5 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..fe1181de8ba0b2e30996ecd0722708564b3a7956 100644
--- a/chrome/test/data/webui/inline_editable_list_test.html
+++ b/chrome/test/data/webui/inline_editable_list_test.html
@@ -108,12 +108,11 @@ 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});
target.dispatchEvent(event);
}
@@ -135,15 +134,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