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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js

Issue 2045603002: Handle the "key" field as opposed to keyIdentifier field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove initialization of the view 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: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
index f584340db8e38ba925c10ae1eb53f82a10c8b2fc..f0dc4d7e5977c7ca6667f80f1a6eea81a1b85ded 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
@@ -521,11 +521,18 @@ InspectorTest.deprecatedRunAfterPendingDispatches = function(callback)
barrier.callWhenDone(InspectorTest.safeWrap(callback));
}
-InspectorTest.createKeyEvent = function(keyIdentifier, ctrlKey, altKey, shiftKey, metaKey)
-{
- var evt = document.createEvent("KeyboardEvent");
- evt.initKeyboardEvent("keydown", true /* can bubble */, true /* can cancel */, null /* view */, keyIdentifier, "", ctrlKey, altKey, shiftKey, metaKey);
- return evt;
+InspectorTest.createKeyEvent = function(key, ctrlKey, altKey, shiftKey, metaKey)
+{
+ var keyIdentifier = key;
+ if (key === "Tab")
+ keyIdentifier = "U+0009";
+ else if (key == "Escape")
+ keyIdentifier = "U+001B";
+ else if (key == "ArrowUp")
+ keyIdentifier = "Up";
+ else if (key == "ArrowDown")
+ keyIdentifier = "Down";
+ return new KeyboardEvent("keydown", {key: key, keyIdentifier: keyIdentifier, bubbles: true, cancelable: true, ctrlKey: ctrlKey, altKey: altKey, shiftKey: shiftKey, metaKey: metaKey});
}
InspectorTest.runTestSuite = function(testSuite)

Powered by Google App Engine
This is Rietveld 408576698