OLD | NEW |
---|---|
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
4 <script src="../resources-test.js"></script> | |
5 <script src="resource-tree-test.js"></script> | |
6 | 4 |
7 <script> | 5 <script> |
8 | 6 |
9 function createCraftedIframe() | 7 function createCraftedIframe() |
10 { | 8 { |
11 var fabricatedFrame = document.createElement("iframe"); | 9 var fabricatedFrame = document.createElement("iframe"); |
12 fabricatedFrame.src = "#foo"; | 10 fabricatedFrame.src = "resources/blank.html"; |
13 document.body.appendChild(fabricatedFrame); | 11 document.body.appendChild(fabricatedFrame); |
14 fabricatedFrame.contentDocument.write("<div>bar</div>"); | 12 fabricatedFrame.contentDocument.write("<div>bar</div>"); |
15 } | 13 } |
16 | 14 |
17 function test() | 15 function test() |
18 { | 16 { |
19 InspectorTest.runAfterResourcesAreFinished(["inspector-test.js", "resources- test.js", "resource-tree-test.js"], step1); | 17 function onExecutionCintextCreated(event) |
20 | |
21 function step1() | |
22 { | 18 { |
23 InspectorTest.addSniffer(WebInspector.resourceTreeModel, "_frameAttached ", InspectorTest.completeTest); | 19 InspectorTest.addResult("ExecutionContextCreated: isMainWorldContext=" + event.data.isMainWorldContext); |
24 InspectorTest.evaluateInPage("createCraftedIframe()"); | |
25 } | 20 } |
21 WebInspector.runtimeModel.addEventListener(WebInspector.RuntimeModel.Events. ExecutionContextCreated, onExecutionCintextCreated, {}); | |
yurys
2014/10/31 15:08:03
Can you turn this into a protocol test so that we
eustas
2014/11/03 20:14:16
Great idea. Updading protocol test I've found that
| |
22 InspectorTest.evaluateInPage("createCraftedIframe()", InspectorTest.complete Test); | |
26 } | 23 } |
27 | 24 |
28 </script> | 25 </script> |
29 | 26 |
30 </head> | 27 </head> |
31 <body onload="runTest()"> | 28 <body onload="runTest()"> |
32 <p>Tests resource tree model on crafted iframe addition (will time out on failur e).</p> | 29 <p>Tests resource tree model on crafted iframe addition (will time out on failur e).</p> |
33 </body> | 30 </body> |
34 </html> | 31 </html> |
OLD | NEW |