summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/inspector/elements/set-outer-html-2.html
blob: 2a8d1963607b58eedc4dd124e304ad420978f3a2 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<html>
<head>

<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/elements-test.js"></script>
<script src="set-outer-html-test.js"></script>
<script>

function onload()
{
    document.getElementById("identity").wrapperIdentity = "identity";
    runTest();
}

function test()
{
    InspectorTest.runTestSuite([
        function testSetUp(next)
        {
            InspectorTest.setUpTestSuite(next);
        },

        function testChangeMultipleThings(next)
        {
            var text = InspectorTest.containerText.replace(/<li>.*<\/li>/, "");
            text = text.replace("<h2>", "<h2 foo=\"bar\" bar=\"baz\">");
            InspectorTest.setOuterHTML(text, next);
        },

        function testChangeNestingLevel(next)
        {
            var text = InspectorTest.containerText.replace("<ul>", "<div><ul>");
            var text = text.replace("</ul>", "</ul></div>");
            InspectorTest.setOuterHTML(text, next);
        },

        function testSwapNodes(next)
        {
            var text = InspectorTest.containerText.replace("<h2>Getting involved</h2>", "");
            var text = text.replace("</div>", "<h2>Getting involved</h2></div>");
            InspectorTest.setOuterHTML(text, next);
        },

        function testEditTwoRoots(next)
        {
            var text = InspectorTest.containerText + "<div>Additional node</div>";
            InspectorTest.setOuterHTML(text, next);
        },

        function testDupeNode(next)
        {
            InspectorTest.patchOuterHTML("<h2>Getting involved</h2>", "<h2>Getting involved</h2><h2>Getting involved</h2>", next);
        }
    ]);
}
</script>
</head>

<body onload="onload()">
<p>
Tests DOMAgent.setOuterHTML protocol method (part 2).
</p>

<div id="container" style="display:none">
<p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc..</p>
<h2>Getting involved</h2>
<p id="identity">There are many ways to get involved. You can:</p>
<ul>
   <li></li>
</ul>
<ul>
   <li></li>
</ul>
</div>

</body>
</html>