layout/base/tests/test_bug582181-2.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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="5" id="testInput">Blah blah
    19 فلان فلان
    20 &lt;ref&gt;ooo&lt;/ref&gt;
    21 &lt;references /&gt;</textarea>
    22 </div>
    23 <pre id="test">
    24 <script class="testbody" type="text/javascript">
    26 /** Test for Bug 582181 **/
    28 SimpleTest.waitForExplicitFinish();
    30 function test() {
    31   var textInput = $("testInput");
    32   var s1, s2, s3, equal, str1, str2;
    34   s1 = snapshotWindow(window);
    36   textInput.focus();
    37   synthesizeKey("VK_DOWN", { });
    38   synthesizeKey("VK_DOWN", { });
    39   synthesizeKey("VK_DOWN", { });
    40   synthesizeKey("VK_DOWN", { });
    41   synthesizeKey("VK_BACK_SPACE", { });
    42   textInput.blur();
    43   s2 = snapshotWindow(window);
    45   [unequal, str1, str2] = compareSnapshots(s1, s2, false);
    46   ok(unequal, "backspace after text should change rendering: got " + str2);
    48   textInput.focus();
    49   synthesizeKey(">", { });
    50   textInput.blur();
    51   s3 = snapshotWindow(window);
    53   [equal, str1, str2] = compareSnapshots(s1, s3, true);
    54   ok(equal, "entering '>' should restore original rendering: expected " + str1 + 
    55      " but got " + str2);
    57   SimpleTest.finish();
    58 }
    60 </script>
    61 </pre>
    62 </body>
    63 </html>

mercurial