content/base/test/test_bug433662.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/test_bug433662.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +<!doctype html>
     1.5 +<!--
     1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=433662
     1.7 +-->
     1.8 +<title>Test for Bug 433662</title>
     1.9 +<script src="/tests/SimpleTest/SimpleTest.js"></script>
    1.10 +<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
    1.11 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=433662">Mozilla Bug 433662</a>
    1.12 +<script>
    1.13 +
    1.14 +/** Test for Bug 433662 **/
    1.15 +var range = document.createRange();
    1.16 +range.setStart(document.body, 0);
    1.17 +range.insertNode(document.createComment("abc"));
    1.18 +is(document.body.firstChild.nodeType, Node.COMMENT_NODE,
    1.19 +   "Comment must be inserted (start of node)");
    1.20 +is(document.body.firstChild.nodeValue, "abc",
    1.21 +   "Comment must have right contents (start of node)");
    1.22 +is(range.endOffset, 1,
    1.23 +   "insertNode() needs to include the newly-added node (start of node)");
    1.24 +
    1.25 +range.setStart(document.body, document.body.childNodes.length);
    1.26 +range.insertNode(document.createComment("def"));
    1.27 +is(document.body.lastChild.nodeType, Node.COMMENT_NODE,
    1.28 +   "Comment must be inserted (end of node)");
    1.29 +is(document.body.lastChild.nodeValue, "def",
    1.30 +   "Comment must have right contents (end of node)");
    1.31 +is(range.endOffset, document.body.childNodes.length,
    1.32 +   "insertNode() needs to include the newly-added node (end of node)");
    1.33 +
    1.34 +</script>

mercurial