editor/libeditor/html/tests/test_bug998188.html

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=565392
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <title>Test for Bug 998188</title>
michael@0 8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
michael@0 9 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
michael@0 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
michael@0 11 </head>
michael@0 12 <body>
michael@0 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=998188">Mozilla Bug 998188</a>
michael@0 14 <p id="display"></p>
michael@0 15 <div id="content" style="display: none">
michael@0 16
michael@0 17 </div>
michael@0 18 <div id="editor" contenteditable>abc</div>
michael@0 19 <pre id="test">
michael@0 20 <script type="application/javascript">
michael@0 21
michael@0 22 /** Test for Bug 998188 **/
michael@0 23
michael@0 24 SimpleTest.waitForExplicitFinish();
michael@0 25
michael@0 26 function runTests()
michael@0 27 {
michael@0 28 var editor = document.getElementById("editor");
michael@0 29 editor.focus();
michael@0 30
michael@0 31 var textNode1 = document.createTextNode("def");
michael@0 32 var textNode2 = document.createTextNode("ghi");
michael@0 33
michael@0 34 editor.appendChild(textNode1);
michael@0 35 editor.appendChild(textNode2);
michael@0 36
michael@0 37 window.getSelection().collapse(textNode2, 3);
michael@0 38
michael@0 39 for (var i = 0; i < 9; i++) {
michael@0 40 var caretRect = synthesizeQueryCaretRect(i);
michael@0 41 ok(caretRect.succeeded, "QueryCaretRect should succeeded (" + i + ")");
michael@0 42 }
michael@0 43
michael@0 44 SimpleTest.finish();
michael@0 45 }
michael@0 46
michael@0 47 SimpleTest.waitForFocus(runTests);
michael@0 48
michael@0 49 </script>
michael@0 50 </pre>
michael@0 51 </body>
michael@0 52 </html>

mercurial