editor/libeditor/html/tests/test_bug725069.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/editor/libeditor/html/tests/test_bug725069.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,35 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=725069
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 725069</title>
    1.11 +  <script type="application/javascript" src="/MochiKit/packed.js"></script>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    1.14 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.15 +</head>
    1.16 +<body contenteditable>abc<!-- XXX -->def<span></span>
    1.17 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=725069">Mozilla Bug 725069</a>
    1.18 +<p id="display"></p>
    1.19 +<pre id="test">
    1.20 +<script type="application/javascript">
    1.21 +
    1.22 +/** Test for Bug 725069 **/
    1.23 +SimpleTest.waitForExplicitFinish();
    1.24 +addLoadEvent(function() {
    1.25 +  var body = document.querySelector("body");
    1.26 +  is(body.firstChild.nodeType, body.TEXT_NODE, "The first node is a text node");
    1.27 +  is(body.firstChild.nodeValue, "abc", "The first text node is there");
    1.28 +  is(body.firstChild.nextSibling.nodeType, body.COMMENT_NODE, "The second node is a comment node");
    1.29 +  is(body.firstChild.nextSibling.nodeValue, " XXX ", "The value of the comment node is not changed");
    1.30 +  is(body.firstChild.nextSibling.nextSibling.nodeType, body.TEXT_NODE, "The last text node is a text node");
    1.31 +  is(body.firstChild.nextSibling.nextSibling.nodeValue, "def", "The last next node is there");
    1.32 +  SimpleTest.finish();
    1.33 +});
    1.34 +
    1.35 +</script>
    1.36 +</pre>
    1.37 +</body>
    1.38 +</html>

mercurial