editor/libeditor/html/tests/test_bug612128.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=612128
     5 -->
     6 <head>
     7   <title>Test for Bug 612128</title>
     8   <script type="application/javascript" src="/MochiKit/packed.js"></script>
     9   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <script type="text/javascript" src="/tests/SimpleTest/EventUtils.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=612128">Mozilla Bug 612128</a>
    15 <p id="display"></p>
    16 <div id="content">
    17 <input>
    18 <div contenteditable></div>
    19 </div>
    20 <pre id="test">
    21 <script type="application/javascript">
    23 /** Test for Bug 612128 **/
    24 SimpleTest.waitForExplicitFinish();
    25 addLoadEvent(function() {
    26   document.querySelector("input").focus();
    27   var threw = false;
    28   try {
    29     is(document.execCommand("inserthtml", null, "<span>f" + "oo</span>"),
    30        false, "The insertHTML command should return false");
    31   } catch (e) {
    32     ok(false, "insertHTML should not throw here");
    33   }
    34   is(document.querySelectorAll("span").length, 0, "No span element should be injected inside the page");
    35   is(document.body.innerHTML.indexOf("f" + "oo"), -1, "No text should be injected inside the page");
    36   SimpleTest.finish();
    37 });
    39 </script>
    40 </pre>
    41 </body>
    42 </html>

mercurial