| Index: third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-document-with-child-nodes.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-document-with-child-nodes.html b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-document-with-child-nodes.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..31a56fe5cb458ac5e7dd84f5550eab132558f4ad
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-document-with-child-nodes.html
|
| @@ -0,0 +1,67 @@
|
| +<html>
|
| +<head>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
|
| +<script type="text/javascript">
|
| +
|
| +function test()
|
| +{
|
| + getDocument();
|
| +
|
| + function getDocument()
|
| + {
|
| + InspectorTest.sendCommand("DOM.getDocument", {"depth": -1}, function(messageObject) {
|
| + if (messageObject.hasOwnProperty("error"))
|
| + InspectorTest.log("Backend error: " + messageObject.error.message + " (" + messageObject.error.code + ")\n");
|
| +
|
| + var iframeOwner = messageObject.result.root.children[0].children[1].children[0].children[0].children[0].children[0];
|
| + if (iframeOwner.contentDocument.children) {
|
| + InspectorTest.log("Error IFrame node should not include children: " + JSON.stringify(iframeOwner, null, " "));
|
| + InspectorTest.completeTest();
|
| + } else {
|
| + getDocumentPlusIframe();
|
| + }
|
| + });
|
| + };
|
| +
|
| +
|
| + function getDocumentPlusIframe()
|
| + {
|
| + InspectorTest.sendCommand("DOM.getDocument", {"depth": -1, "traverseFrames": true}, function(messageObject) {
|
| + if (messageObject.hasOwnProperty("error"))
|
| + InspectorTest.log("Backend error: " + messageObject.error.message + " (" + messageObject.error.code + ")\n");
|
| +
|
| + var iframeOwner = messageObject.result.root.children[0].children[1].children[0].children[0].children[0].children[0];
|
| +
|
| + // FrameIds change every time, so replace them.
|
| + iframeOwner.frameId = "???";
|
| + iframeOwner.contentDocument.children[0].frameId = "???";
|
| +
|
| + // The contentDocument's documentURL & baseURL are absolute paths.
|
| + iframeOwner.contentDocument.documentURL = "???";
|
| + iframeOwner.contentDocument.baseURL = "???";
|
| +
|
| + var bodyId = messageObject.result.root.children[0].children[1];
|
| + InspectorTest.log(JSON.stringify(bodyId, null, " "));
|
| + InspectorTest.completeTest();
|
| + });
|
| + };
|
| +};
|
| +
|
| +window.addEventListener("DOMContentLoaded", function () {
|
| + runTest();
|
| +}, false);
|
| +
|
| +</script>
|
| +</head>
|
| +<body>
|
| +
|
| +<div id="depth-1">
|
| + <div id="depth-2">
|
| + <div id="depth-3">
|
| + <iframe src="resources/iframe.html"></iframe>
|
| + </div>
|
| + </div>
|
| +</div>
|
| +
|
| +</body>
|
| +</html>
|
|
|