test_bug332655-2.html (1900B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=332655 5 --> 6 <head> 7 <title>Test for Bug 332655</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/WindowSnapshot.js"></script> 10 <script src="/tests/SimpleTest/EventUtils.js"></script> 11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 12 </head> 13 <body onload="test()"> 14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=332655">Mozilla Bug 332655</a> 15 <p id="display"></p> 16 <div id="content"> 17 <input type="text" id="testInput" 18 style="-moz-appearance: none"> <!-- bug 1234659 workaround --> 19 </div> 20 <pre id="test"> 21 <script class="testbody" type="text/javascript"> 22 23 /** Test for Bug 332655 */ 24 25 SimpleTest.waitForExplicitFinish(); 26 27 function test() { 28 var textInput = $("testInput"); 29 var s1, s2, s3, equal, str1, str2; 30 31 textInput.focus(); 32 sendString("\u05d0"); 33 sendString("ab "); 34 sendString("\u05d1\u05d2"); 35 s1 = snapshotWindow(window); 36 37 // 4 LEFT to get to the beginning of the line: HOME doesn't work on OS X 38 synthesizeKey("KEY_ArrowLeft", {repeat: 4}); 39 synthesizeKey("KEY_Backspace"); 40 sendString("\u05d0"); 41 s2 = snapshotWindow(window); 42 43 [equal, str1, str2] = compareSnapshots(s1, s2, true); 44 ok(equal, "deleting and inserting RTL char at beginning of line shouldn't change: expected " + 45 str1 + " but got " + str2); 46 47 textInput.select(); 48 sendString("ab "); 49 sendString("\u05d1\u05d2"); 50 // 4 LEFT to get to the beginning of the line: HOME doesn't work on OS X 51 synthesizeKey("KEY_ArrowLeft", {repeat: 4}); 52 sendString("\u05d0"); 53 54 s3 = snapshotWindow(window); 55 56 [equal, str1, str2] = compareSnapshots(s1, s3, true); 57 ok(equal, "the order entering Bidi text shouldn't change rendering: expected " + 58 str1 + " but got " + str2); 59 60 SimpleTest.finish(); 61 } 62 63 </script> 64 </pre> 65 </body> 66 </html>