OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="profiler-test.js"></script> | 4 <script src="profiler-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function test() | 7 function test() |
8 { | 8 { |
9 var nodesCount = 1000; | 9 var nodesCount = 1000; |
10 function buildTree(startId, count) | 10 function buildTree(startId, count) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 { | 53 { |
54 "functionName": "(idle)", | 54 "functionName": "(idle)", |
55 "scriptId": "0", | 55 "scriptId": "0", |
56 "url": "a.js", | 56 "url": "a.js", |
57 "lineNumber": 1 | 57 "lineNumber": 1 |
58 }, | 58 }, |
59 "hitCount": 2, | 59 "hitCount": 2, |
60 "children": [] | 60 "children": [] |
61 } | 61 } |
62 ].concat(buildTree(2, nodesCount)), | 62 ].concat(buildTree(2, nodesCount)), |
63 "idleTime": 0.002, | |
64 "startTime": 0, | 63 "startTime": 0, |
65 "endTime": nodesCount * 0.01 + 0.003 | 64 "endTime": nodesCount * 10e3 + 3e3 |
66 } | 65 } |
67 }; | 66 }; |
68 var view = new WebInspector.CPUProfileView(profileAndExpectations); | 67 var view = new WebInspector.CPUProfileView(profileAndExpectations); |
69 view.viewSelectComboBox.setSelectedIndex(1); | 68 view.viewSelectComboBox.setSelectedIndex(1); |
70 view._changeView(); | 69 view._changeView(); |
71 var tree = view.profileDataGridTree; | 70 var tree = view.profileDataGridTree; |
72 if (!tree) | 71 if (!tree) |
73 InspectorTest.addResult("no tree"); | 72 InspectorTest.addResult("no tree"); |
74 tree.performSearch(new WebInspector.SearchableView.SearchConfig("foo12", tru
e, false), false); | 73 tree.performSearch(new WebInspector.SearchableView.SearchConfig("foo12", tru
e, false), false); |
75 for (var item of tree._searchResults) { | 74 for (var item of tree._searchResults) { |
76 var node = item.profileNode; | 75 var node = item.profileNode; |
77 InspectorTest.addResult(`${node.callUID}: ${node.functionName} ${node.se
lf} ${node.total}`); | 76 InspectorTest.addResult(`${node.callUID}: ${node.functionName} ${node.se
lf} ${node.total}`); |
78 } | 77 } |
79 InspectorTest.completeProfilerTest(); | 78 InspectorTest.completeProfilerTest(); |
80 } | 79 } |
81 | 80 |
82 </script> | 81 </script> |
83 </head> | 82 </head> |
84 <body onload="runTest()"> | 83 <body onload="runTest()"> |
85 <p> | 84 <p> |
86 Tests that search works for large bottom-up view of CPU profile. | 85 Tests that search works for large bottom-up view of CPU profile. |
87 </p> | 86 </p> |
88 </body> | 87 </body> |
89 </html> | 88 </html> |
OLD | NEW |