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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/input-events/input-events-typing-data-manual.html

Issue 2919603002: [WPT] Add automated manual test for InputEvent typing (Closed)
Patch Set: foolip's comments: Fix nits Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <title>InputEvent have data when typing on textarea and contenteditable</title>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 <p>To manually run this test, please follow the steps below:<br/>
7 1. Focus the first box and press key 'a' and then 'b'.<br/>
8 2. Focus the second box and press key 'c' and then 'd'.<br/>
9 <br/>
10 If a "PASS" result appears the test passes, otherwise it fails</p>
11 <textarea id='plain'></textarea>
12 <div id='rich' style='border-style: solid;' contenteditable></div>
13 <script>
14 async_test(t => {
15 const expectedResult = [
16 'plain-beforeinput-a',
17 'plain-input-a',
18 'plain-beforeinput-b',
19 'plain-input-b',
20 'rich-beforeinput-c',
21 'rich-input-c',
22 'rich-beforeinput-d',
23 'rich-input-d',
24 ];
25 let eventCounter = 0;
26
27 for (const targetId of ['plain', 'rich']) {
28 for (const eventType of ['beforeinput', 'input']) {
29 document.getElementById(targetId).addEventListener(eventType, t.step _func(e => {
30 assert_equals(`${targetId}-${eventType}-${e.data}`, expectedResu lt[eventCounter]);
31 ++eventCounter;
32 if (eventCounter === expectedResult.length)
33 t.done();
34 }));
35 }
36 }
37 })
38 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt_automation/input-events/input-events-typing-data-manual-automation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698