Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / elements / edit / set-outer-html-body.html
blobe88dfb3f3ee516a83130ce63aeba0a5ae61f6185
1 <html>
2 <head>
4 <script src="../../../http/tests/inspector/inspector-test.js"></script>
5 <script src="../../../http/tests/inspector/elements-test.js"></script>
6 <script>
8 function test()
10 var htmlNode;
11 var bodyNode;
12 var headNode;
14 InspectorTest.runTestSuite([
15 function testSetUp(next)
17 InspectorTest.expandElementsTree(step1);
18 function step1()
20 htmlNode = InspectorTest.expandedNodeWithId("html");
21 headNode = InspectorTest.expandedNodeWithId("head");
22 bodyNode = InspectorTest.expandedNodeWithId("body");
23 next();
27 function testSetBody(next)
29 InspectorTest.DOMAgent.setOuterHTML(bodyNode.id, "<body>New body content</body>", dumpHTML(next));
32 function testInsertComments(next)
34 InspectorTest.DOMAgent.setOuterHTML(bodyNode.id, "<!-- new comment between head and body --><body>New body content</body>", dumpHTML(next));
37 function testSetHead(next)
39 InspectorTest.DOMAgent.setOuterHTML(headNode.id, "<head><!-- new head content --></head>", dumpHTML(next));
42 function testSetHTML(next)
44 InspectorTest.DOMAgent.setOuterHTML(htmlNode.id, "<html><head><!-- new head content --></head><body>Setting body as a part of HTML.</body></html>", dumpHTML(next));
46 ]);
48 function dumpHTML(next)
50 function dump()
52 InspectorTest.DOMAgent.getOuterHTML(htmlNode.id, callback);
53 function callback(error, text)
55 InspectorTest.addResult(error ? error : text);
56 next();
59 return dump;
62 </script>
63 </head>
65 <body>
66 <p>
67 Tests DOMAgent.setOuterHTML invoked on body tag. See https://bugs.webkit.org/show_bug.cgi?id=62272.
68 <iframe src="../resources/set-outer-html-body-iframe.html" onload="runTest()"></iframe>
69 </p>
70 </body>
71 </html>