| Index: third_party/WebKit/LayoutTests/external/wpt_automation/input-events/inputevent_common_input.js
|
| diff --git a/third_party/WebKit/LayoutTests/external/wpt_automation/input-events/inputevent_common_input.js b/third_party/WebKit/LayoutTests/external/wpt_automation/input-events/inputevent_common_input.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f846acb098e5c1b27ace0dec8fe4b463de834b1c
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/external/wpt_automation/input-events/inputevent_common_input.js
|
| @@ -0,0 +1,22 @@
|
| +// Returns a Promise for future conversion into WebDriver-backed API.
|
| +function keyDown(key, modifiers) {
|
| + return new Promise(function(resolve, reject) {
|
| + if (window.eventSender) {
|
| + eventSender.keyDown(key, modifiers);
|
| + resolve();
|
| + } else {
|
| + reject();
|
| + }
|
| + });
|
| +}
|
| +
|
| +function focusAndKeyDown(selector, key, modifiers) {
|
| + document.querySelector(selector).focus();
|
| + return keyDown(key, modifiers);
|
| +}
|
| +
|
| +{
|
| + const inputevent_automation = async_test("InputEvent Automation");
|
| + // Defined in every test and should return a promise that gets resolved when input is finished.
|
| + inject_input().then(inputevent_automation.step_func_done());
|
| +}
|
|
|