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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/input/keyboard-ctrl-enter-no-newline.html

Issue 1942683004: Ctrl/Alt+Enter shouldn't insert newline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix existing tests for Ctrl/Alt Enter Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Ctrl+Enter shouldn't insert newline</title>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 </head>
8 <body>
9 <textarea id="txt"></textarea>
10 <script>
11 test(function() {
12 if (!window.eventSender) {
13 document.write('This test requires eventSender');
yosin_UTC9 2016/05/09 03:52:51 nit: Use |return| to avoid else-clauses to reduce
chongz 2016/05/09 21:21:01 Done.
14 } else {
15 var txt = document.getElementById('txt');
16 txt.focus();
17 // Ctrl+Enter shouldn't insert new line.
18 txt.value = '';
19 eventSender.keyDown('\n', ['ctrlKey']);
20 assert_equals(txt.value, '');
21 // Alt+Enter shouldn't insert new line.
22 txt.value = '';
23 eventSender.keyDown('\n', ['altKey']);
24 assert_equals(txt.value, '');
25 // Alt+Shift+Enter shouldn't insert new line.
26 txt.value = '';
27 eventSender.keyDown('\n', ['altKey', 'shiftKey']);
28 assert_equals(txt.value, '');
29 // Enter should insert new line.
30 txt.value = '';
31 eventSender.keyDown('\n', []);
32 assert_equals(txt.value, '\n');
33 // Shift+Enter should insert line break.
34 txt.value = '';
35 eventSender.keyDown('\n', ['shiftKey']);
36 assert_equals(txt.value, '\n');
37 }
38 }, 'Testing Ctrl+Enter shouldn\'t insert newline');
39 </script>
40 </body>
41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698