| 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> | 4 <script src="../resources-test.js"></script> |
| 5 <script src="resource-tree-test.js"></script> | 5 <script src="resource-tree-test.js"></script> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 function loadIframe() | 8 function loadIframe() |
| 9 { | 9 { |
| 10 var iframe = document.createElement("iframe"); | 10 var iframe = document.createElement("iframe"); |
| 11 iframe.src = "resources/dummy-iframe.html"; | 11 iframe.src = "resources/dummy-iframe.html"; |
| 12 document.body.appendChild(iframe); | 12 document.body.appendChild(iframe); |
| 13 } | 13 } |
| 14 | 14 |
| 15 function test() | 15 function test() |
| 16 { | 16 { |
| 17 InspectorTest.resourceTreeModel.addEventListener(WebInspector.ResourceTreeMo
del.Events.FrameNavigated, waitForResources); | 17 InspectorTest.resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Event
s.FrameNavigated, waitForResources); |
| 18 InspectorTest.evaluateInPage("loadIframe()"); | 18 InspectorTest.evaluateInPage("loadIframe()"); |
| 19 | 19 |
| 20 function waitForResources() | 20 function waitForResources() |
| 21 { | 21 { |
| 22 InspectorTest.resourceTreeModel.removeEventListener(WebInspector.Resourc
eTreeModel.Events.FrameNavigated, waitForResources); | 22 InspectorTest.resourceTreeModel.removeEventListener(SDK.ResourceTreeMode
l.Events.FrameNavigated, waitForResources); |
| 23 InspectorTest.runAfterResourcesAreFinished(["dummy-iframe.html", "inspec
tor-test.js", "resources-test.js", "resource-tree-test.js"], dump); | 23 InspectorTest.runAfterResourcesAreFinished(["dummy-iframe.html", "inspec
tor-test.js", "resources-test.js", "resource-tree-test.js"], dump); |
| 24 } | 24 } |
| 25 | 25 |
| 26 function dump() | 26 function dump() |
| 27 { | 27 { |
| 28 function formatter(resource) | 28 function formatter(resource) |
| 29 { | 29 { |
| 30 return resource.url + " => " + resource.documentURL; | 30 return resource.url + " => " + resource.documentURL; |
| 31 } | 31 } |
| 32 | 32 |
| 33 InspectorTest.dumpResources(formatter); | 33 InspectorTest.dumpResources(formatter); |
| 34 InspectorTest.completeTest(); | 34 InspectorTest.completeTest(); |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 | 37 |
| 38 </script> | 38 </script> |
| 39 | 39 |
| 40 </head> | 40 </head> |
| 41 | 41 |
| 42 <body onload="runTest()"> | 42 <body onload="runTest()"> |
| 43 <p> | 43 <p> |
| 44 Tests that resources have proper documentURL set in the tree model. | 44 Tests that resources have proper documentURL set in the tree model. |
| 45 </p> | 45 </p> |
| 46 | 46 |
| 47 </body> | 47 </body> |
| 48 </html> | 48 </html> |
| OLD | NEW |