| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 | |
| 4 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 5 <script src="../../http/tests/inspector/elements-test.js"></script> | |
| 6 <script> | |
| 7 | |
| 8 function test() | |
| 9 { | |
| 10 var htmlNode; | |
| 11 var bodyNode; | |
| 12 var headNode; | |
| 13 | |
| 14 InspectorTest.runTestSuite([ | |
| 15 function testSetUp(next) | |
| 16 { | |
| 17 InspectorTest.expandElementsTree(step1); | |
| 18 function step1() | |
| 19 { | |
| 20 htmlNode = InspectorTest.expandedNodeWithId("html"); | |
| 21 headNode = InspectorTest.expandedNodeWithId("head"); | |
| 22 bodyNode = InspectorTest.expandedNodeWithId("body"); | |
| 23 next(); | |
| 24 } | |
| 25 }, | |
| 26 | |
| 27 function testSetBody(next) | |
| 28 { | |
| 29 InspectorTest.DOMAgent.setOuterHTML(bodyNode.id, "<body>New body con
tent</body>", dumpHTML(next)); | |
| 30 }, | |
| 31 | |
| 32 function testInsertComments(next) | |
| 33 { | |
| 34 InspectorTest.DOMAgent.setOuterHTML(bodyNode.id, "<!-- new comment b
etween head and body --><body>New body content</body>", dumpHTML(next)); | |
| 35 }, | |
| 36 | |
| 37 function testSetHead(next) | |
| 38 { | |
| 39 InspectorTest.DOMAgent.setOuterHTML(headNode.id, "<head><!-- new hea
d content --></head>", dumpHTML(next)); | |
| 40 }, | |
| 41 | |
| 42 function testSetHTML(next) | |
| 43 { | |
| 44 InspectorTest.DOMAgent.setOuterHTML(htmlNode.id, "<html><head><!-- n
ew head content --></head><body>Setting body as a part of HTML.</body></html>",
dumpHTML(next)); | |
| 45 } | |
| 46 ]); | |
| 47 | |
| 48 function dumpHTML(next) | |
| 49 { | |
| 50 function dump() | |
| 51 { | |
| 52 InspectorTest.DOMAgent.getOuterHTML(htmlNode.id, callback); | |
| 53 function callback(error, text) | |
| 54 { | |
| 55 InspectorTest.addResult(error ? error : text); | |
| 56 next(); | |
| 57 } | |
| 58 } | |
| 59 return dump; | |
| 60 } | |
| 61 } | |
| 62 </script> | |
| 63 </head> | |
| 64 | |
| 65 <body> | |
| 66 <p> | |
| 67 Tests DOMAgent.setOuterHTML invoked on body tag. See https://bugs.webkit.org/sho
w_bug.cgi?id=62272. | |
| 68 <iframe src="resources/set-outer-html-body-iframe.html" onload="runTest()"></ifr
ame> | |
| 69 </p> | |
| 70 </body> | |
| 71 </html> | |
| OLD | NEW |