tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_bug582181-1.html (1594B)


      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 src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <script src="/tests/SimpleTest/WindowSnapshot.js"></script>
     11  <script 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" style="resize: none" 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("KEY_ArrowDown");
     36  synthesizeKey("KEY_ArrowDown");
     37  synthesizeKey("KEY_Enter");
     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("KEY_Backspace");
     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>