summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/inspector/elements/insert-node-collapsed.html
blob: c8b4b62d34af6b8152acaef70794df6c4855c987 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/elements-test.js"></script>
<script>

function appendChild()
{
    var container = document.getElementById("container");
    var child = document.createElement("div");
    child.setAttribute("id", "appended");
    container.appendChild(child);
}

function test()
{
    var containerNode;

    InspectorTest.runTestSuite([
        function testDumpInitial(next)
        {
            function callback(node)
            {
                containerNode = node;
                InspectorTest.addResult("========= Original ========");
                InspectorTest.dumpElementsTree(containerNode);
                next();
            }
            InspectorTest.selectNodeWithId("container", callback);
        },

        function testAppend(next) {
            function callback()
            {
                InspectorTest.addResult("======== Appended =========");
                InspectorTest.dumpElementsTree(containerNode);
                next();
            }
            InspectorTest.evaluateInPage("appendChild()", callback);
        }
    ]);
}

</script>
</head>

<body onload="runTest()">
<p>
Tests that elements panel updates hasChildren flag upon adding children to collapsed nodes.
</p>

<div id="container"></div>

</body>
</html>