test_bug644768.html (2020B)
1 <!-- This Source Code Form is subject to the terms of the Mozilla Public 2 - License, v. 2.0. If a copy of the MPL was not distributed with this 3 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 4 5 <!DOCTYPE html> 6 <html> 7 <!-- 8 https://bugzilla.mozilla.org/show_bug.cgi?id=644768 9 --> 10 <head> 11 <title>Test for Bug 644768</title> 12 <script src="/tests/SimpleTest/SimpleTest.js"></script> 13 <script src="/tests/SimpleTest/WindowSnapshot.js"></script> 14 <script src="/tests/SimpleTest/EventUtils.js"></script> 15 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 16 </head> 17 <body onload="test()"> 18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=644768">Mozilla Bug 644768</a> 19 <p id="display"></p> 20 <div id="content"> 21 <!-- test text is 22 == زادروزها == 23 * [[۱۳۰۷]] 24 --> 25 <textarea id="testInput" dir="rtl" cols="80" rows="25" style="-moz-appearance:none"> 26 27 == زادروزها == 28 * [[۱۳۰۷]]</textarea> 29 </div> 30 <pre id="test"> 31 <script class="testbody" type="text/javascript"> 32 33 /** Test for Bug 644768 */ 34 35 SimpleTest.waitForExplicitFinish(); 36 37 function test() { 38 var textInput = $("testInput"); 39 var s1, s2, equal, str1, str2; 40 41 textInput.focus(); 42 s1 = snapshotWindow(window); 43 44 synthesizeKey("KEY_ArrowUp"); 45 synthesizeKey("KEY_ArrowUp"); 46 synthesizeKey("KEY_ArrowUp"); 47 synthesizeKey("KEY_Delete"); 48 synthesizeKey("KEY_Enter"); 49 // Bug 1016184: Touch caret will hide due to key event. 50 s2 = snapshotWindow(window); 51 52 [equal, str1, str2] = compareSnapshots(s1, s2, true); 53 ok(equal, "newline before bidi text shouldn't change direction: expected " + 54 str1 + " but got " + str2); 55 56 SimpleTest.finish(); 57 } 58 59 </script> 60 </pre> 61 </body> 62 </html>