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

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: Yosin's review 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/input/resources/reveal-utilities.js » ('j') | 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 <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');
14 return;
15 }
16 var txt = document.getElementById('txt');
17 txt.focus();
18 // Ctrl+Enter shouldn't insert new line.
19 txt.value = '';
20 eventSender.keyDown('\n', ['ctrlKey']);
21 assert_equals(txt.value, '');
22 // Alt+Enter shouldn't insert new line.
23 txt.value = '';
24 eventSender.keyDown('\n', ['altKey']);
25 assert_equals(txt.value, '');
26 // Alt+Shift+Enter shouldn't insert new line.
27 txt.value = '';
28 eventSender.keyDown('\n', ['altKey', 'shiftKey']);
29 assert_equals(txt.value, '');
30 // Enter should insert new line.
31 txt.value = '';
32 eventSender.keyDown('\n', []);
33 assert_equals(txt.value, '\n');
34 // Shift+Enter should insert line break.
35 txt.value = '';
36 eventSender.keyDown('\n', ['shiftKey']);
37 assert_equals(txt.value, '\n');
38 }, 'Testing Ctrl+Enter shouldn\'t insert newline');
39 </script>
40 </body>
41 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/input/resources/reveal-utilities.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698