|
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 type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script> |
|
10 <script type="application/javascript" 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 </div> |
|
19 <pre id="test"> |
|
20 <script class="testbody" type="text/javascript"> |
|
21 |
|
22 /** Test for Bug 332655 **/ |
|
23 |
|
24 SimpleTest.waitForExplicitFinish(); |
|
25 |
|
26 function test() { |
|
27 var textInput = $("testInput"); |
|
28 var s1, s2, s3, equal, str1, str2; |
|
29 |
|
30 textInput.focus(); |
|
31 synthesizeKey("a", { }); |
|
32 synthesizeKey("b", { }); |
|
33 synthesizeKey(" ", { }); |
|
34 synthesizeKey("\u05d0", { }); |
|
35 synthesizeKey("\u05d1", { }); |
|
36 s1 = snapshotWindow(window); |
|
37 |
|
38 synthesizeKey(" ", { }); |
|
39 s2 = snapshotWindow(window); |
|
40 |
|
41 [equal, str1, str2] = compareSnapshots(s1, s2, true); |
|
42 ok(equal, "space after LTR + RTL shouldn't change direction: expected " + |
|
43 str1 + " but got " + str2); |
|
44 |
|
45 synthesizeKey("VK_BACK_SPACE", { }); |
|
46 s3 = snapshotWindow(window); |
|
47 |
|
48 [equal, str1, str2] = compareSnapshots(s1, s3, true); |
|
49 ok(equal, "backspace should restore the status quo: expected " + str1 + |
|
50 " but got " + str2); |
|
51 |
|
52 SimpleTest.finish(); |
|
53 } |
|
54 |
|
55 </script> |
|
56 </pre> |
|
57 </body> |
|
58 </html> |
|
59 |