layout/base/tests/test_bug582181-1.html

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:7b00add24b2b
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=582181
5 -->
6 <head>
7 <title>Test for Bug 582181</title>
8 <meta charset="utf-8">
9 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
11 <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
12 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
13 </head>
14 <body onload="test()">
15 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=582181">Mozilla Bug 582181</a>
16 <p id="display"></p>
17 <div id="content" dir="rtl">
18 <textarea rows="4" id="testInput">فارسی
19 [[en:Farsi]]</textarea>
20 </div>
21 <pre id="test">
22 <script class="testbody" type="text/javascript">
23
24 /** Test for Bug 582181 **/
25
26 SimpleTest.waitForExplicitFinish();
27
28 function test() {
29 var textInput = $("testInput");
30 var s1, s2, s3, equal, str1, str2;
31
32 s1 = snapshotWindow(window);
33
34 textInput.focus();
35 synthesizeKey("VK_DOWN", { });
36 synthesizeKey("VK_DOWN", { });
37 synthesizeKey("VK_RETURN", { });
38 textInput.blur();
39 s2 = snapshotWindow(window);
40
41 [equal, str1, str2] = compareSnapshots(s1, s2, true);
42 ok(equal, "enter after text shouldn't change rendering: expected " +
43 str1 + " but got " + str2);
44
45 textInput.focus();
46 synthesizeKey("VK_BACK_SPACE", { });
47 textInput.blur();
48 s3 = snapshotWindow(window);
49
50 [equal, str1, str2] = compareSnapshots(s1, s3, true);
51 ok(equal, "backspace shouldn't change rendering: expected " + str1 +
52 " but got " + str2);
53
54 SimpleTest.finish();
55 }
56
57 </script>
58 </pre>
59 </body>
60 </html>

mercurial