layout/base/tests/test_bug582181-1.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

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=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">
    24 /** Test for Bug 582181 **/
    26 SimpleTest.waitForExplicitFinish();
    28 function test() {
    29   var textInput = $("testInput");
    30   var s1, s2, s3, equal, str1, str2;
    32   s1 = snapshotWindow(window);
    34   textInput.focus();
    35   synthesizeKey("VK_DOWN", { });
    36   synthesizeKey("VK_DOWN", { });
    37   synthesizeKey("VK_RETURN", { });
    38   textInput.blur();
    39   s2 = snapshotWindow(window);
    41   [equal, str1, str2] = compareSnapshots(s1, s2, true);
    42   ok(equal, "enter after text shouldn't change rendering: expected " +
    43      str1 + " but got " + str2);
    45   textInput.focus();
    46   synthesizeKey("VK_BACK_SPACE", { });
    47   textInput.blur();
    48   s3 = snapshotWindow(window);
    50   [equal, str1, str2] = compareSnapshots(s1, s3, true);
    51   ok(equal, "backspace shouldn't change rendering: expected " + str1 + 
    52      " but got " + str2);
    54   SimpleTest.finish();
    55 }
    57 </script>
    58 </pre>
    59 </body>
    60 </html>

mercurial