blob: ed55eb65c3e64e4a5f4fa2c3478960c2c854c0b3 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
<script>
function test()
{
let suite = InspectorTest.createAsyncSuite("DOM.getOuterHTML");
suite.addTestCase({
name: "GetOuterHTML",
description: "Get the OuterHTML of the target element.",
test(resolve, reject) {
WI.domTreeManager.requestDocument(function(documentNode) {
WI.domTreeManager.querySelector(documentNode.id, "#x", function(nodeId) {
let domNode = WI.domTreeManager.nodeForId(nodeId);
InspectorTest.assert(domNode, "DOMNode exists");
domNode.getOuterHTML(function(error, outerHTML) {
InspectorTest.expectNoError(error);
InspectorTest.log("Dumping outerHTML for element div#x:");
InspectorTest.log(outerHTML);
resolve();
});
});
});
}
});
suite.runTestCasesAndFinish();
}
</script>
</head>
<body onload="runTest()">
<p>Test for DOM.getOuterHTML (Copy HTML).</p>
<div id="x" style="display:none">
<h1>A Title</h1>
<p>A Paragraph</p>
</div>
</body>
</html>