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

Unified 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: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698