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

Side by Side Diff: chrome/test/data/keyboardevent_code_test.html

Issue 2946103002: Add KeyboardEventCodeInteractiveTest
Patch Set: This iteration is expected to fail on Windows as https://codereview.chromium.org/2939283002/ is req… 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
« no previous file with comments | « chrome/test/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <!--
3 The html / js to help testing keyboard events. It receives keyboard events and
4 writes the key codes to /html/body/div[@id='container']. Once KeyX is
5 received, it sends the recorded key codes to window.domAutomationController.
6 -->
7 <html>
8 <head>
9 <title>KeyboardEvent.code Test</title>
10 <script>
11 let done = false;
12
13 function report() {
14 return new Promise((resolve, reject) => {
15 const register = () => {
16 window.setTimeout(() => {
17 if (done) {
18 resolve();
19 } else {
20 register();
21 }
22 }, 100);
23 }
24 register();
25 }).then(() => {
26 window.domAutomationController.send(container().innerHTML);
27 });
28 }
29
30 function container() {
31 return document.getElementById('container');
32 }
33
34 function init() {
35 document.addEventListener('keypress', (e) => {
36 container().innerHTML += e.code + '\n';
37 if (e.code == 'KeyX') {
38 done = true;
39 }
40 });
41 }
42 </script>
43 </head>
44 <body onload='init()'>
45 <div id='container'>
46 </div>
47 </body>
48 </html>
OLDNEW
« no previous file with comments | « chrome/test/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698