4 https://bugzilla.mozilla.org/show_bug.cgi?id=596506
7 <title>Test for Bug
596506</title>
8 <script type=
"application/javascript" src=
"/MochiKit/packed.js"></script>
9 <script type=
"application/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
11 <script type=
"text/javascript" src=
"/tests/SimpleTest/EventUtils.js"></script>
14 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=596506">Mozilla Bug
596506</a>
16 <div id=
"content" style=
"display: none">
20 <script type=
"application/javascript">
22 /** Test for Bug
596506 **/
24 SimpleTest.waitForExplicitFinish();
25 SimpleTest.waitForFocus(runTest);
27 const kIsMac = navigator.platform.indexOf(
"Mac") ==
0;
29 function append(str) {
30 for (var i =
0; i < str.length; ++i) {
31 synthesizeKey(str[i], {});
36 var edit = document.getElementById(
"edit");
40 synthesizeKey(
"VK_ENTER", {});
42 synthesizeKey(
"VK_UP", {});
43 synthesizeKey(
"VK_UP", {});
45 synthesizeKey(
"VK_RIGHT", {accelKey: true});
47 synthesizeKey(
"VK_END", {});
50 is(edit.value,
"Firstly\nSecond",
51 "Pressing end should position the cursor before the terminating newline");
58 <textarea id=
"edit"></textarea>