chromium/third_party/blink/web_tests/editing/input/keyboard-ctrl-enter-no-newline.html

<!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('Enter', ['ctrlKey']);
    assert_equals(txt.value, '');
    // Alt+Enter shouldn't insert new line.
    txt.value = '';
    eventSender.keyDown('Enter', ['altKey']);
    assert_equals(txt.value, '');
    // Alt+Shift+Enter shouldn't insert new line.
    txt.value = '';
    eventSender.keyDown('Enter', ['altKey', 'shiftKey']);
    assert_equals(txt.value, '');
    // Enter should insert new line.
    txt.value = '';
    eventSender.keyDown('Enter', []);
    assert_equals(txt.value, '\n');
    // Shift+Enter should insert line break.
    txt.value = '';
    eventSender.keyDown('Enter', ['shiftKey']);
    assert_equals(txt.value, '\n');
}, 'Testing Ctrl+Enter shouldn\'t insert newline');
</script>
</body>
</html>