Web Inspector: speed up _calculateRetainedSizes function
[WebKit-https.git] / PerformanceTests / inspector / first-open-resources.html
1 <html>
2 <head>
3 <script src="../../LayoutTests/http/tests/inspector/inspector-test.js"></script>
4 <script src="performance-test.js"></script>
5 <script>
6
7 function test()
8 {
9     WebInspector.showPanel("resources");
10     WebInspector.settings.resourcesLastSelectedItem.set(WebInspector.inspectedPageURL);
11
12     function test(timer)
13     {
14         WebInspector.showPanel("audits");
15         var resources = WebInspector.panels.resources;
16         resources.reset();
17         var treeModel = WebInspector.resourceTreeModel;
18         treeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameAdded, resources._frameAdded, resources);
19         treeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, resources._frameNavigated, resources);
20         treeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameDetached, resources._frameDetached, resources);
21         treeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.ResourceAdded, resources._resourceAdded, resources);
22         resources._initialized = false;
23
24         InspectorTest.addBackendResponseSniffer(ApplicationCacheAgent, "getFramesWithManifests", finish);
25         var showPanelTimerCookie = timer.start("first-open-resources");
26         treeModel._fetchResourceTree();
27         WebInspector.showPanel("resources");
28
29         function finish()
30         {
31             timer.finish(showPanelTimerCookie);
32             timer.done("first-open");
33         }
34     }
35     InspectorTest.runPerformanceTest(test, 5000);
36 }
37
38 </script>
39 </head>
40 <body onload="runTest()">
41 </body>
42 </body>
43 </html>
44