2011-04-12 Pavel Feldman <pfeldman@google.com>
[WebKit-https.git] / LayoutTests / http / tests / inspector / resource-tree-model.html
1 <html>
2 <head>
3 <script src="inspector-test.js"></script>
4 <script src="resources-test.js"></script>
5
6 <script>
7
8 function loadIframe()
9 {
10     var iframe = document.createElement("iframe");
11     iframe.src = "resources/dummy-iframe.php";
12     document.body.appendChild(iframe);
13 }
14
15 var test = function()
16 {
17     WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, onResourceFinished);
18
19     var urls = [];
20     function onResourceFinished(event)
21     {
22         WebInspector.resourceTreeModel.forAllResources(printResource);
23         urls.sort();
24         urls.forEach(InspectorTest.addResult);
25         InspectorTest.completeTest();
26     }
27
28     function printResource(resource)
29     {
30         urls.push(resource.url + " => " + resource.documentURL);
31     }
32
33     InspectorTest.evaluateInPage("loadIframe()");    
34 }
35
36 </script>
37
38 </head>
39
40 <body onload="runTest()">
41 <p>
42 Tests resource tree model.
43 </p>
44
45 </body>
46 </html>