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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html

Issue 1752933002: [InputEvent] Fire 'beforeinput' during typing, pressing hot keys and IME composition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on WebEditingCommandType & Yosin's review 2 Created 4 years, 8 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 <html>
3 <head>
4 <title>InputEvent: beforeinput data</title>
5 <script src="../../../resources/testharness.js"></script>
6 <script src="../../../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <input type="text" id="txt">
10 <script>
11 test(function() {
12 var lastData = "";
yosin_UTC9 2016/04/13 06:13:08 Please use single-quote in script fragment since o
chongz 2016/04/13 23:53:08 Done.
13 var txt = document.getElementById('txt');
14 txt.addEventListener('beforeinput', function(e) {
yosin_UTC9 2016/04/13 06:13:08 nit: Please avoid to use single-letter variable na
chongz 2016/04/13 23:53:08 Done.
15 lastData = e.data;
16 });
17 if (!window.eventSender) {
18 document.write('This test requires eventSender');
19 } else {
20 function testKeyDownData(key, modifiers, data) {
21 eventSender.keyDown(key, modifiers);
22 assert_equals(lastData, data, "${modifiers.toString()}+${key} should produce data: ${data}");
yosin_UTC9 2016/04/13 06:13:08 I think you mean `${modifiers.toString()}....`. Te
chongz 2016/04/13 23:53:08 Done.
23 }
24
25 txt.focus();
26 // Typing
27 testKeyDownData('a', [], 'a');
28 testKeyDownData('4', [], '4');
29 testKeyDownData('backspace', [], '');
30 // Shift+foo doesn't work with eventSender, but actually |data| is corre ct according to manual tests.
31 // testKeyDownData('l', ['shiftKey'], 'L');
32 // testKeyDownData('6', ['shiftKey'], '^');
33 testKeyDownData(' ', [], ' ');
34 }
35 }, "Testing beforeinput data");
yosin_UTC9 2016/04/13 06:13:08 Please use single-quote in script fragment since o
chongz 2016/04/13 23:53:08 Done.
36 </script>
37 </body>
38 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698