Web Inspector: speed up _calculateRetainedSizes function
[WebKit-https.git] / PerformanceTests / inspector / network-append-30-requests.html.broken
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 makeXHRRequests(count)
8 {
9     for (var i = 0; i < count; ++i) {
10         var xhr = new XMLHttpRequest();
11         xhr.open("GET", document.URL, true);
12         xhr.send();
13     }
14 }
15
16 function test()
17 {
18     WebInspector.showPanel("network");
19
20     var originalRefresh = InspectorTest.override(WebInspector.panels.network._networkLogView, "refresh", timeTrackingRefresh, true);
21     WebInspector.panels.network._networkLogView._defaultRefreshDelay = 30;
22     function timeTrackingRefresh()
23     {
24         var cookie = InspectorTest.timer.start("network-append-30-requests");
25         originalRefresh.call(this);
26         InspectorTest.timer.finish(cookie);
27         WebInspector.panels.network._networkLogView._reset();
28         // In real life this array is cleaning up at navigation event.
29         WebInspector.networkLog._resources = [];
30         InspectorTest.timer.done("panel-update");
31     }
32
33     function test(timer)
34     {
35         InspectorTest.evaluateInPage("makeXHRRequests(30)");
36     }
37
38     InspectorTest.runPerformanceTest(test, 15000);
39 }
40
41 if (!window.layoutTestController) {
42     setTimeout(function() {
43         makeXHRRequests(30);
44     }, 3000);
45 }
46
47 </script>
48 </head>
49
50 <body onload="runTest()">
51 </body>
52 </html>