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

Side by Side Diff: LayoutTests/inspector/profiler/cpu-profiler-calculate-time.html

Issue 235453008: DevTools: Extract CPU profile model out of CPUProfileView. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html » ('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 // Profile for 1070ms, 2140 samples. 9 // Profile for 1070ms, 2140 samples.
10 var profileAndExpectations = { 10 var profileAndExpectations = {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 ] 87 ]
88 }, 88 },
89 ] 89 ]
90 }, 90 },
91 "idleTime": 202.88199791684747, 91 "idleTime": 202.88199791684747,
92 "startTime": 1375445600.000847, 92 "startTime": 1375445600.000847,
93 "endTime": 1375445601.070847, 93 "endTime": 1375445601.070847,
94 "samples": [ 1, 2 ] 94 "samples": [ 1, 2 ]
95 }; 95 };
96 WebInspector.inspectorView.showPanel("profiles"); 96 WebInspector.inspectorView.showPanel("profiles");
97 WebInspector.CPUProfileView.prototype._calculateTimes(profileAndExpectations ); 97 WebInspector.CPUProfileDataModel.prototype._calculateTimes(profileAndExpecta tions);
98 function checkExpectations(node) 98 function checkExpectations(node)
99 { 99 {
100 if (Math.abs(node.selfTime - node.expectedSelfTime) > 0.0001) { 100 if (Math.abs(node.selfTime - node.expectedSelfTime) > 0.0001) {
101 InspectorTest.addResult("totalTime: " + node.totalTime + ", expected :" + node.expectedTotalTime); 101 InspectorTest.addResult("totalTime: " + node.totalTime + ", expected :" + node.expectedTotalTime);
102 return false; 102 return false;
103 } 103 }
104 if (Math.abs(node.totalTime - node.expectedTotalTime) > 0.0001) { 104 if (Math.abs(node.totalTime - node.expectedTotalTime) > 0.0001) {
105 InspectorTest.addResult("totalTime: " + node.totalTime + ", expected :" + node.expectedTotalTime); 105 InspectorTest.addResult("totalTime: " + node.totalTime + ", expected :" + node.expectedTotalTime);
106 return false; 106 return false;
107 } 107 }
(...skipping 11 matching lines...) Expand all
119 } 119 }
120 120
121 </script> 121 </script>
122 </head> 122 </head>
123 <body onload="runTest()"> 123 <body onload="runTest()">
124 <p> 124 <p>
125 Tests self and total time calculation in CPU profiler. 125 Tests self and total time calculation in CPU profiler.
126 </p> 126 </p>
127 </body> 127 </body>
128 </html> 128 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698