Clean up code imported from WebKitAPITest
[WebKit-https.git] / LayoutTests / inspector / performance / resources / show-panel-network.html
1 <html>
2 <head>
3 <script src="../../../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
17 function test()
18 {
19     WebInspector.showPanel("network");
20     InspectorTest.evaluateInPage("makeXHRRequests(30)", step1);
21
22     function step1()
23     {
24         function perfTest1(timer)
25         {
26             WebInspector.showPanel("audits");
27             var timerCookie = timer.start("show-network-panel");
28             WebInspector.showPanel("network");
29             timer.finish(timerCookie);
30             timer.done();
31         }
32
33         InspectorTest.runPerformanceTest(perfTest1, 5000);
34     }
35 }
36
37 if (!window.layoutTestController) {
38     setTimeout(function() {
39         makeXHRRequests(700);
40     }, 3000);
41 }
42
43 </script>
44 </head>
45
46 <body onload="runTest()">
47 </body>
48 </html>