Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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">
22 /** Test for Bug 332655 **/
24 SimpleTest.waitForExplicitFinish();
26 function test() {
27 var textInput = $("testInput");
28 var s1, s2, s3, equal, str1, str2;
30 textInput.focus();
31 synthesizeKey("a", { });
32 synthesizeKey("b", { });
33 synthesizeKey(" ", { });
34 synthesizeKey("\u05d0", { });
35 synthesizeKey("\u05d1", { });
36 s1 = snapshotWindow(window);
38 synthesizeKey(" ", { });
39 s2 = snapshotWindow(window);
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);
45 synthesizeKey("VK_BACK_SPACE", { });
46 s3 = snapshotWindow(window);
48 [equal, str1, str2] = compareSnapshots(s1, s3, true);
49 ok(equal, "backspace should restore the status quo: expected " + str1 +
50 " but got " + str2);
52 SimpleTest.finish();
53 }
55 </script>
56 </pre>
57 </body>
58 </html>