editor/libeditor/text/tests/test_bug596001.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=596001
     5 -->
     6 <head>
     7   <title>Test for Bug 596001</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=596001">Mozilla Bug 596001</a>
    14 <p id="display"></p>
    15 <div id="content">
    16 <textarea id="src">a&#9;b</textarea>
    17 <textarea id="dst"></textarea>
    18 </div>
    19 <pre id="test">
    20 <script type="application/javascript">
    22 /** Test for Bug 596001 **/
    24 function testTab(prefix, callback) {
    25   var src = document.getElementById("src");
    26   var dst = document.getElementById("dst");
    27   dst.value = prefix;
    28   src.focus();
    29   src.select();
    30   SimpleTest.waitForClipboard("a\tb",
    31     function() {
    32       synthesizeKey("c", {accelKey: true});
    33     },
    34     function() {
    35       dst.focus();
    36       var inputReceived = false;
    37       dst.addEventListener("input", function() inputReceived = true, false);
    38       synthesizeKey("v", {accelKey: true});
    39       ok(inputReceived, "An input event should be raised");
    40       is(dst.value, prefix + src.value, "The value should be pasted verbatim");
    41       callback();
    42     },
    43     callback
    44   );
    45 }
    47 testTab("", function() {
    48   testTab("foo", function() {
    49   });
    50 });
    52 </script>
    53 </pre>
    54 </body>
    55 </html>

mercurial