| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
| 4 <script type="text/javascript"> | 4 <script type="text/javascript"> |
| 5 | 5 |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 getDocument(); | 8 getDocument(); |
| 9 | 9 |
| 10 function getDocument() | 10 function getDocument() |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 InspectorTest.log("Error IFrame node should not include children
: " + JSON.stringify(iframeContentDocument, null, " ")); | 32 InspectorTest.log("Error IFrame node should not include children
: " + JSON.stringify(iframeContentDocument, null, " ")); |
| 33 InspectorTest.completeTest(); | 33 InspectorTest.completeTest(); |
| 34 } else { | 34 } else { |
| 35 getDocumentIncludingIframe(); | 35 getDocumentIncludingIframe(); |
| 36 } | 36 } |
| 37 }; | 37 }; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 function getDocumentIncludingIframe() | 40 function getDocumentIncludingIframe() |
| 41 { | 41 { |
| 42 InspectorTest.sendCommand("DOM.getDocument", {"traverseFrames": true}, f
unction(messageObject) { | 42 InspectorTest.sendCommand("DOM.getDocument", {"pierce": true}, function(
messageObject) { |
| 43 if (messageObject.hasOwnProperty("error")) | 43 if (messageObject.hasOwnProperty("error")) |
| 44 InspectorTest.log("Backend error: " + messageObject.error.messag
e + " (" + messageObject.error.code + ")\n"); | 44 InspectorTest.log("Backend error: " + messageObject.error.messag
e + " (" + messageObject.error.code + ")\n"); |
| 45 | 45 |
| 46 var bodyId = messageObject.result.root.children[0].children[1].nodeI
d; | 46 var bodyId = messageObject.result.root.children[0].children[1].nodeI
d; |
| 47 requestAllChildNodesIncludingIframe(bodyId); | 47 requestAllChildNodesIncludingIframe(bodyId); |
| 48 }); | 48 }); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 function replacePropertyRecursive(object, propertyNameToReplace) | 51 function replacePropertyRecursive(object, propertyNameToReplace) |
| 52 { | 52 { |
| 53 for (var propertyName in object) { | 53 for (var propertyName in object) { |
| 54 if (!object.hasOwnProperty(propertyName)) | 54 if (!object.hasOwnProperty(propertyName)) |
| 55 continue; | 55 continue; |
| 56 if (propertyName === propertyNameToReplace) { | 56 if (propertyName === propertyNameToReplace) { |
| 57 object[propertyName] = "???"; | 57 object[propertyName] = "???"; |
| 58 } else if (typeof object[propertyName] === "object") { | 58 } else if (typeof object[propertyName] === "object") { |
| 59 replacePropertyRecursive(object[propertyName], propertyNameToRep
lace); | 59 replacePropertyRecursive(object[propertyName], propertyNameToRep
lace); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 function requestAllChildNodesIncludingIframe(bodyId) | 64 function requestAllChildNodesIncludingIframe(bodyId) |
| 65 { | 65 { |
| 66 InspectorTest.sendCommand("DOM.requestChildNodes", {"nodeId": bodyId, "d
epth": -1, "traverseFrames": true}, function(messageObject) { | 66 InspectorTest.sendCommand("DOM.requestChildNodes", {"nodeId": bodyId, "d
epth": -1, "pierce": true}, function(messageObject) { |
| 67 if (messageObject.hasOwnProperty("error")) | 67 if (messageObject.hasOwnProperty("error")) |
| 68 InspectorTest.log("Backend error: " + messageObject.error.messag
e + " (" + messageObject.error.code + ")\n"); | 68 InspectorTest.log("Backend error: " + messageObject.error.messag
e + " (" + messageObject.error.code + ")\n"); |
| 69 }); | 69 }); |
| 70 | 70 |
| 71 InspectorTest.eventHandler["DOM.setChildNodes"] = function(messageObject
) | 71 InspectorTest.eventHandler["DOM.setChildNodes"] = function(messageObject
) |
| 72 { | 72 { |
| 73 // Replace properties that tend to change every run. | 73 // Replace properties that tend to change every run. |
| 74 replacePropertyRecursive(messageObject, "frameId"); | 74 replacePropertyRecursive(messageObject, "frameId"); |
| 75 replacePropertyRecursive(messageObject, "documentURL"); | 75 replacePropertyRecursive(messageObject, "documentURL"); |
| 76 replacePropertyRecursive(messageObject, "baseURL"); | 76 replacePropertyRecursive(messageObject, "baseURL"); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 97 <div id="depth-1"> | 97 <div id="depth-1"> |
| 98 <div id="depth-2"> | 98 <div id="depth-2"> |
| 99 <div id="depth-3"> | 99 <div id="depth-3"> |
| 100 <iframe src="resources/iframe.html"></iframe> | 100 <iframe src="resources/iframe.html"></iframe> |
| 101 </div> | 101 </div> |
| 102 </div> | 102 </div> |
| 103 </div> | 103 </div> |
| 104 | 104 |
| 105 </body> | 105 </body> |
| 106 </html> | 106 </html> |
| OLD | NEW |