test_bug332655-1.html (1493B)
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 1204897 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("ab "); 33 sendString("\u05d0\u05d1"); 34 s1 = snapshotWindow(window); 35 36 sendString(" "); 37 s2 = snapshotWindow(window); 38 39 [equal, str1, str2] = compareSnapshots(s1, s2, true); 40 ok(equal, "space after LTR + RTL shouldn't change direction: expected " + 41 str1 + " but got " + str2); 42 43 synthesizeKey("KEY_Backspace"); 44 s3 = snapshotWindow(window); 45 46 [equal, str1, str2] = compareSnapshots(s1, s3, true); 47 ok(equal, "backspace should restore the status quo: expected " + str1 + 48 " but got " + str2); 49 50 SimpleTest.finish(); 51 } 52 53 </script> 54 </pre> 55 </body> 56 </html>