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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/trace-event-self-time.html

Issue 2721663005: [DevTools] Access cpu profiler only when JS capability is present. (Closed)
Patch Set: rebased Created 3 years, 9 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="../../http/tests/inspector/timeline-test.js"></script> 4 <script src="../../http/tests/inspector/timeline-test.js"></script>
5 <script> 5 <script>
6 function test() 6 function test()
7 { 7 {
8 var sessionId = "6.23"; 8 var sessionId = "6.23";
9 var rawTraceEvents = [ 9 var rawTraceEvents = [
10 { 10 {
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 { 280 {
281 callFrame: { functionName: "baz" }, 281 callFrame: { functionName: "baz" },
282 id: 4 282 id: 4
283 } 283 }
284 ], 284 ],
285 timeDeltas: new Array(9).fill(1000), 285 timeDeltas: new Array(9).fill(1000),
286 samples: [2, 2, 3, 3, 3, 4, 4, 2, 2] 286 samples: [2, 2, 3, 3, 3, 4, 4, 2, 2]
287 }; 287 };
288 288
289 var timelineController = InspectorTest.timelineController(); 289 var timelineController = InspectorTest.timelineController();
290 timelineController._addCpuProfile(SDK.targetManager.mainTarget().id(), null, cpuProfile); 290 timelineController._addCpuProfile(SDK.targetManager.mainTarget().id(), cpuPr ofile);
291 timelineController.traceEventsCollected(rawTraceEvents); 291 timelineController.traceEventsCollected(rawTraceEvents);
292 timelineController._finalizeTrace(); 292 timelineController._finalizeTrace();
293 var events = timelineController._performanceModel.timelineModel().inspectedT argetEvents(); 293 var events = timelineController._performanceModel.timelineModel().inspectedT argetEvents();
294 events.forEach(e => InspectorTest.addResult(`${e.name}: ${e.startTime} ${(e. selfTime || 0).toFixed(2)}/${(e.duration || 0).toFixed(2)}`)); 294 events.forEach(e => InspectorTest.addResult(`${e.name}: ${e.startTime} ${(e. selfTime || 0).toFixed(2)}/${(e.duration || 0).toFixed(2)}`));
295 InspectorTest.completeTest(); 295 InspectorTest.completeTest();
296 } 296 }
297 297
298 </script> 298 </script>
299 </head> 299 </head>
300 <body onload="runTest()"> 300 <body onload="runTest()">
301 </body> 301 </body>
302 </html> 302 </html>
303 303
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698