Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/input-events/input-events-typing-data-manual.html |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/input-events/input-events-typing-data-manual.html b/third_party/WebKit/LayoutTests/external/wpt/input-events/input-events-typing-data-manual.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2f0608c01f2a7ee125a4781566407140a10e37b4 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/input-events/input-events-typing-data-manual.html |
| @@ -0,0 +1,38 @@ |
| +<!DOCTYPE html> |
| +<meta charset="utf-8"> |
| +<title>InputEvent have data when typing on textarea and contenteditable</title> |
| +<script src="/resources/testharness.js"></script> |
| +<script src="/resources/testharnessreport.js"></script> |
| +<p>To manually run this test, please follow the steps below:<br/> |
| +1. Focus the first box and press key 'a' and then 'b'.<br/> |
| +2. Focus the second box and press key 'c' and then 'd'.<br/> |
| +<br/> |
| +If a "PASS" result appears the test passes, otherwise it fails</p> |
| +<textarea id='plain'></textarea> |
| +<div id='rich' style='border-style: solid;' contenteditable></div> |
| +<script> |
| +async_test(t => { |
| + const expectedResult = [ |
| + 'plain-beforeinput-a', |
| + 'plain-input-a', |
| + 'plain-beforeinput-b', |
| + 'plain-input-b', |
| + 'rich-beforeinput-c', |
| + 'rich-input-c', |
| + 'rich-beforeinput-d', |
| + 'rich-input-d', |
| + ]; |
| + let eventCounter = 0; |
| + |
| + ['plain', 'rich'].forEach(targetId => { |
|
foolip
2017/06/01 13:54:21
Optional nit: I like to use `for (x of [...])` in
chongz
2017/06/01 15:34:13
Done.
|
| + ['beforeinput', 'input'].forEach(eventType => { |
| + document.getElementById(targetId).addEventListener(eventType, t.step_func(e => { |
| + assert_equals(`${targetId}-${eventType}-${e.data}`, expectedResult[eventCounter]); |
| + ++eventCounter; |
| + if (eventCounter >= expectedResult.length) |
|
foolip
2017/06/01 13:54:21
nit: nothing that happens after the t.done() call
chongz
2017/06/01 15:34:13
Done.
|
| + t.done(); |
| + })); |
| + }); |
| + }); |
| +}) |
| +</script> |