Bug 630001, part2 - fix nsAccUtils::TextLength to not use nsIFrame::GetRenderedText...
[mozilla-central.git] / editor / libeditor / text / tests / test_bug596506.html
blobf350dde504c52aa7f6af878bbc2526262441473d
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=596506
5 -->
6 <head>
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>
12 </head>
13 <body>
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=596506">Mozilla Bug 596506</a>
15 <p id="display"></p>
16 <div id="content" style="display: none">
18 </div>
19 <pre id="test">
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], {});
35 function runTest() {
36 var edit = document.getElementById("edit");
37 edit.focus();
39 append("First");
40 synthesizeKey("VK_ENTER", {});
41 append("Second");
42 synthesizeKey("VK_UP", {});
43 synthesizeKey("VK_UP", {});
44 if (kIsMac) {
45 synthesizeKey("VK_RIGHT", {accelKey: true});
46 } else {
47 synthesizeKey("VK_END", {});
49 append("ly");
50 is(edit.value, "Firstly\nSecond",
51 "Pressing end should position the cursor before the terminating newline");
52 SimpleTest.finish();
55 </script>
56 </pre>
58 <textarea id="edit"></textarea>
60 </body>
61 </html>