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

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

Issue 2100243002: Remove non-standardize key code names from event_sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix inspector tests that were missed by sed Created 4 years, 5 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Ctrl+Enter shouldn't insert newline</title> 4 <title>Ctrl+Enter shouldn't insert newline</title>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 </head> 7 </head>
8 <body> 8 <body>
9 <textarea id="txt"></textarea> 9 <textarea id="txt"></textarea>
10 <script> 10 <script>
11 test(function() { 11 test(function() {
12 if (!window.eventSender) { 12 if (!window.eventSender) {
13 document.write('This test requires eventSender'); 13 document.write('This test requires eventSender');
14 return; 14 return;
15 } 15 }
16 var txt = document.getElementById('txt'); 16 var txt = document.getElementById('txt');
17 txt.focus(); 17 txt.focus();
18 // Ctrl+Enter shouldn't insert new line. 18 // Ctrl+Enter shouldn't insert new line.
19 txt.value = ''; 19 txt.value = '';
20 eventSender.keyDown('\n', ['ctrlKey']); 20 eventSender.keyDown('Enter', ['ctrlKey']);
21 assert_equals(txt.value, ''); 21 assert_equals(txt.value, '');
22 // Alt+Enter shouldn't insert new line. 22 // Alt+Enter shouldn't insert new line.
23 txt.value = ''; 23 txt.value = '';
24 eventSender.keyDown('\n', ['altKey']); 24 eventSender.keyDown('Enter', ['altKey']);
25 assert_equals(txt.value, ''); 25 assert_equals(txt.value, '');
26 // Alt+Shift+Enter shouldn't insert new line. 26 // Alt+Shift+Enter shouldn't insert new line.
27 txt.value = ''; 27 txt.value = '';
28 eventSender.keyDown('\n', ['altKey', 'shiftKey']); 28 eventSender.keyDown('Enter', ['altKey', 'shiftKey']);
29 assert_equals(txt.value, ''); 29 assert_equals(txt.value, '');
30 // Enter should insert new line. 30 // Enter should insert new line.
31 txt.value = ''; 31 txt.value = '';
32 eventSender.keyDown('\n', []); 32 eventSender.keyDown('Enter', []);
33 assert_equals(txt.value, '\n'); 33 assert_equals(txt.value, '\n');
34 // Shift+Enter should insert line break. 34 // Shift+Enter should insert line break.
35 txt.value = ''; 35 txt.value = '';
36 eventSender.keyDown('\n', ['shiftKey']); 36 eventSender.keyDown('Enter', ['shiftKey']);
37 assert_equals(txt.value, '\n'); 37 assert_equals(txt.value, '\n');
38 }, 'Testing Ctrl+Enter shouldn\'t insert newline'); 38 }, 'Testing Ctrl+Enter shouldn\'t insert newline');
39 </script> 39 </script>
40 </body> 40 </body>
41 </html> 41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698