tor-browser

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

test_bug681229.html (1239B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=681229
      5 -->
      6 <head>
      7  <title>Test for Bug 681229</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <script src="/tests/SimpleTest/EventUtils.js"></script>
     10  <script src="/tests/SimpleTest/WindowSnapshot.js"></script>
     11  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     12 </head>
     13 <body>
     14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=681229">Mozilla Bug 681229</a>
     15 <p id="display"></p>
     16 <div id="content">
     17 <textarea spellcheck="false"></textarea>
     18 </div>
     19 <pre id="test">
     20 <script type="application/javascript">
     21 
     22 /** Test for Bug 681229 */
     23 
     24 SimpleTest.waitForExplicitFinish();
     25 SimpleTest.waitForFocus(function() {
     26  var t = document.querySelector("textarea");
     27  t.focus();
     28 
     29  const kValue = "a\r\nb";
     30 
     31  SimpleTest.waitForClipboard(
     32    kValue.replace(/\r\n?/g, "\n"),
     33    function() {
     34      SpecialPowers.clipboardCopyString(kValue);
     35    },
     36    function() {
     37      synthesizeKey("V", {accelKey: true});
     38      is(t.value, "a\nb", "The carriage return has been correctly sanitized");
     39      SimpleTest.finish();
     40    },
     41    function() {
     42      SimpleTest.finish();
     43    }
     44  );
     45 });
     46 
     47 </script>
     48 </pre>
     49 </body>
     50 </html>