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) |