Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times.html

Issue 1873973002: DevTools: extract CPU profile independent part of CPUProfileNode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 profileAndExpectations = { 9 var profileAndExpectations = {
10 "title": "profile1", 10 "title": "profile1",
11 "target": function() { 11 "target": function() {
12 return WebInspector.targetManager.targets()[0]; 12 return WebInspector.targetManager.targets()[0];
13 }, 13 },
14 "_profile": { 14 "_profile": {
15 "head": { 15 "head": {
16 "functionName": "(root)", 16 "functionName": "(root)",
17 "scriptId": "0", 17 "scriptId": "0",
18 "url": "a.js", 18 "url": "a.js",
19 "lineNumber": 0, 19 "lineNumber": 0,
20 "hitCount": 50, 20 "hitCount": 350,
21 "callUID": 1000, 21 "callUID": 1000,
22 "children": [ 22 "children": [
23 { 23 {
24 "functionName": "(idle)", 24 "functionName": "(idle)",
25 "scriptId": "0", 25 "scriptId": "0",
26 "url": "a.js", 26 "url": "a.js",
27 "lineNumber": 1, 27 "lineNumber": 1,
28 "hitCount": 300, 28 "hitCount": 1000,
29 "callUID": 2, 29 "callUID": 2,
30 "children": [] 30 "children": []
31 }, 31 },
32 { 32 {
33 "functionName": "A", 33 "functionName": "A",
34 "scriptId": "0", 34 "scriptId": "0",
35 "url": "a.js", 35 "url": "a.js",
36 "lineNumber": 4642, 36 "lineNumber": 4642,
37 "hitCount": 250, 37 "hitCount": 250,
38 "callUID": 1001, 38 "callUID": 1001,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 "hitCount": 30, 82 "hitCount": 30,
83 "callUID": 3000, 83 "callUID": 3000,
84 "children": [] 84 "children": []
85 } 85 }
86 ] 86 ]
87 } 87 }
88 ] 88 ]
89 } 89 }
90 ] 90 ]
91 }, 91 },
92 "idleTime": 0.300,
93 "startTime": 0, 92 "startTime": 0,
94 "endTime": 1.000 93 "endTime": 1.000
95 } 94 }
96 }; 95 };
97 var view = new WebInspector.CPUProfileView(profileAndExpectations); 96 var view = new WebInspector.CPUProfileView(profileAndExpectations);
98 view.viewSelectComboBox.setSelectedIndex(1); 97 view.viewSelectComboBox.setSelectedIndex(1);
99 view._changeView(); 98 view._changeView();
100 var tree = view.profileDataGridTree; 99 var tree = view.profileDataGridTree;
101 if (!tree) 100 if (!tree)
102 InspectorTest.addResult("no tree"); 101 InspectorTest.addResult("no tree");
103 var node = tree.children[0]; 102 var node = tree.children[0];
104 if (!node) 103 if (!node)
105 InspectorTest.addResult("no node"); 104 InspectorTest.addResult("no node");
106 while (node) { 105 while (node) {
107 InspectorTest.addResult(node.callUID + ": " + node.functionName + " " + node.selfTime + " " + node.totalTime + " " + node.element().textContent); 106 InspectorTest.addResult(node.callUID + ": " + node.functionName + " " + node.selfTime + " " + node.totalTime + " " + node.element().textContent);
108 node = node.traverseNextNode(true, null, true); 107 node = node.traverseNextNode(true, null, true);
109 } 108 }
110 InspectorTest.completeProfilerTest(); 109 InspectorTest.completeProfilerTest();
111 } 110 }
112 111
113 </script> 112 </script>
114 </head> 113 </head>
115 <body onload="runTest()"> 114 <body onload="runTest()">
116 <p> 115 <p>
117 Tests bottom-up view self and total time calculation in CPU profiler. 116 Tests bottom-up view self and total time calculation in CPU profiler.
118 </p> 117 </p>
119 </body> 118 </body>
120 </html> 119 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-bottom-up-times-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698