editor/libeditor/text/tests/test_bug681229.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=681229
     5 -->
     6 <head>
     7   <title>Test for Bug 681229</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    10   <script type="text/javascript" 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">
    22 /** Test for Bug 681229 **/
    24 SimpleTest.waitForExplicitFinish();
    25 SimpleTest.waitForFocus(function() {
    26   var t = document.querySelector("textarea");
    27   t.focus();
    29   const kValue = "a\r\nb";
    30   const kExpectedValue = (navigator.platform.indexOf("Win") == 0) ?
    31     "a\nb" : kValue;
    33   SimpleTest.waitForClipboard(kExpectedValue,
    34     function() {
    35       SpecialPowers.copyString(kValue, document);
    36     },
    37     function() {
    38       synthesizeKey("V", {accelKey: true});
    39       is(t.value, "a\nb", "The carriage return has been correctly sanitized");
    40       SimpleTest.finish();
    41     },
    42     function() {
    43       SimpleTest.finish();
    44     }
    45   );
    46 });
    48 </script>
    49 </pre>
    50 </body>
    51 </html>

mercurial