Commit 64cd0f94 authored by philipj@opera.com's avatar philipj@opera.com

Simplify full-screen-test.js's runWithKeyDown()

Review URL: https://codereview.chromium.org/469203002

git-svn-id: svn://svn.chromium.org/blink/trunk@180373 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 09f7ee79
...@@ -13,22 +13,14 @@ if (window.testRunner) { ...@@ -13,22 +13,14 @@ if (window.testRunner) {
function runWithKeyDown(fn) function runWithKeyDown(fn)
{ {
// FIXME: WKTR does not yet support the keyDown() message. Do a mouseDown here
// instead until keyDown support is added.
var eventName = !window.testRunner || eventSender.keyDown ? 'keypress' : 'mousedown'
function thunk() { function thunk() {
document.removeEventListener(eventName, thunk, false); document.removeEventListener("keypress", thunk, false);
fn(); fn();
} }
document.addEventListener(eventName, thunk, false); document.addEventListener("keypress", thunk, false);
if (window.testRunner) { if (window.eventSender)
if (eventSender.keyDown)
eventSender.keyDown(" ", []); eventSender.keyDown(" ", []);
else
eventSender.mouseDown();
}
} }
function logConsole() function logConsole()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment