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

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

Issue 1889963003: Revert of DevTools: extract CPU profile independent part of CPUProfileNode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 } 86 }
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.ProfileTreeModel.prototype._calculateTotals(profileAndExpectati ons.head); 96 WebInspector.CPUProfileDataModel.prototype._calculateTimes(profileAndExpecta tions);
97 function checkExpectations(node) 97 function checkExpectations(node)
98 { 98 {
99 if (Math.abs(node.selfTime - node.expectedSelfTime) > 0.0001) { 99 if (Math.abs(node.selfTime - node.expectedSelfTime) > 0.0001) {
100 InspectorTest.addResult("totalTime: " + node.totalTime + ", expected :" + node.expectedTotalTime); 100 InspectorTest.addResult("totalTime: " + node.totalTime + ", expected :" + node.expectedTotalTime);
101 return false; 101 return false;
102 } 102 }
103 if (Math.abs(node.totalTime - node.expectedTotalTime) > 0.0001) { 103 if (Math.abs(node.totalTime - node.expectedTotalTime) > 0.0001) {
104 InspectorTest.addResult("totalTime: " + node.totalTime + ", expected :" + node.expectedTotalTime); 104 InspectorTest.addResult("totalTime: " + node.totalTime + ", expected :" + node.expectedTotalTime);
105 return false; 105 return false;
106 } 106 }
(...skipping 11 matching lines...) Expand all
118 } 118 }
119 119
120 </script> 120 </script>
121 </head> 121 </head>
122 <body onload="runTest()"> 122 <body onload="runTest()">
123 <p> 123 <p>
124 Tests self and total time calculation in CPU profiler. 124 Tests self and total time calculation in CPU profiler.
125 </p> 125 </p>
126 </body> 126 </body>
127 </html> 127 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698