Web Inspector: speed up _calculateRetainedSizes function
[WebKit-https.git] / PerformanceTests / inspector / console-300-lines.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 makeConsoleEvents(count)
8 {
9     for (var i = 0; i < count; ++i)
10         console.log("Console log: " + i);
11 }
12
13 function test()
14 {
15     var message = {
16         "method":"Console.messageAdded",
17         "params":{
18             "message":{
19                 "source":"console-api",
20                 "level":"log",
21                 "text":"Console log message",
22                 "type":"log",
23                 "line":10,
24                 "url":"file://./console-300-lines.html",
25                 "repeatCount":1,
26                 "parameters":[{
27                     "type":"string",
28                     "value":"Console log: 42"
29                 }],
30                 "stackTrace":[
31                     {
32                         "functionName":"makeConsoleEvents",
33                         "url":"file://./console-300-lines.html",
34                         "lineNumber":10,
35                         "columnNumber":17
36                     },
37                     {
38                         "functionName":"",
39                         "url":"file://./console-300-lines.html",
40                         "lineNumber":37,
41                         "columnNumber":9
42                     }
43                 ]
44             }
45         }
46     };
47
48     WebInspector.showPanel("console");
49
50     function test(timer)
51     {
52         WebInspector.console.clearMessages();
53         InspectorTest.addSniffer(WebInspector.consoleView.promptElement, "scrollIntoView", finish);
54
55         var cookie = timer.start("console-300-lines");
56         for (var i = 0; i < 300; ++i)
57             InspectorBackend.dispatch(message);
58
59         function finish()
60         {
61             timer.finish(cookie);
62             timer.done("panel-update");
63         }
64     }
65
66     InspectorTest.runPerformanceTest(test, 10000);
67 }
68
69 if (!window.layoutTestController) {
70     setTimeout(function() {
71         makeConsoleEvents(300);
72     }, 3000);
73 }
74
75 </script>
76 </head>
77
78 <body onload="runTest()">
79 </body>
80 </html>