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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/input/keyboard-ctrl-enter-no-newline.html
diff --git a/third_party/WebKit/LayoutTests/editing/input/keyboard-ctrl-enter-no-newline.html b/third_party/WebKit/LayoutTests/editing/input/keyboard-ctrl-enter-no-newline.html
new file mode 100644
index 0000000000000000000000000000000000000000..c163d5041191bbd6a2b9e6c8e9bd5ec6f8e68ea3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/input/keyboard-ctrl-enter-no-newline.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Ctrl+Enter shouldn't insert newline</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+</head>
+<body>
+<textarea id="txt"></textarea>
+<script>
+test(function() {
+ if (!window.eventSender) {
+ document.write('This test requires eventSender');
+ return;
+ }
+ var txt = document.getElementById('txt');
+ txt.focus();
+ // Ctrl+Enter shouldn't insert new line.
+ txt.value = '';
+ eventSender.keyDown('\n', ['ctrlKey']);
+ assert_equals(txt.value, '');
+ // Alt+Enter shouldn't insert new line.
+ txt.value = '';
+ eventSender.keyDown('\n', ['altKey']);
+ assert_equals(txt.value, '');
+ // Alt+Shift+Enter shouldn't insert new line.
+ txt.value = '';
+ eventSender.keyDown('\n', ['altKey', 'shiftKey']);
+ assert_equals(txt.value, '');
+ // Enter should insert new line.
+ txt.value = '';
+ eventSender.keyDown('\n', []);
+ assert_equals(txt.value, '\n');
+ // Shift+Enter should insert line break.
+ txt.value = '';
+ eventSender.keyDown('\n', ['shiftKey']);
+ assert_equals(txt.value, '\n');
+}, 'Testing Ctrl+Enter shouldn\'t insert newline');
+</script>
+</body>
+</html>
« 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