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

Side by Side Diff: LayoutTests/http/tests/inspector/timeline-test.js

Issue 1315373005: DevTools: remove most convenience wrappers from WI.TimelineModel.Record (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | LayoutTests/inspector/tracing/timeline-coalescing.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 var initialize_Timeline = function() { 1 var initialize_Timeline = function() {
2 2
3 InspectorTest.preloadPanel("timeline"); 3 InspectorTest.preloadPanel("timeline");
4 WebInspector.TempFile = InspectorTest.TempFileMock; 4 WebInspector.TempFile = InspectorTest.TempFileMock;
5 5
6 // Scrub values when printing out these properties in the record or data field. 6 // Scrub values when printing out these properties in the record or data field.
7 InspectorTest.timelinePropertyFormatters = { 7 InspectorTest.timelinePropertyFormatters = {
8 children: "formatAsTypeName", 8 children: "formatAsTypeName",
9 endTime: "formatAsTypeName", 9 endTime: "formatAsTypeName",
10 requestId: "formatAsTypeName", 10 requestId: "formatAsTypeName",
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 276
277 InspectorTest.dumpTimelineRecords = function(timelineRecords) 277 InspectorTest.dumpTimelineRecords = function(timelineRecords)
278 { 278 {
279 for (var i = 0; i < timelineRecords.length; ++i) 279 for (var i = 0; i < timelineRecords.length; ++i)
280 InspectorTest.dumpTimelineRecord(timelineRecords[i], 0); 280 InspectorTest.dumpTimelineRecord(timelineRecords[i], 0);
281 }; 281 };
282 282
283 InspectorTest.printTimelineRecordProperties = function(record) 283 InspectorTest.printTimelineRecordProperties = function(record)
284 { 284 {
285 InspectorTest.addResult(record.type() + " Properties:"); 285 InspectorTest.addResult(record.type() + " Properties:");
286 var object = {}; 286 var traceEvent = record.traceEvent();
287 var names = ["data", "endTime", "frameId", "stackTrace", "startTime", "threa d", "type"]; 287 var data = traceEvent.args["beginData"] || traceEvent.args["data"];
288 for (var i = 0; i < names.length; i++) { 288 var frameId = data && data["frame"];
289 var name = names[i]; 289 var object = {
290 var value = record[name].call(record); 290 data: traceEvent.args["data"] || traceEvent.args,
291 if (value) 291 endTime: record.endTime(),
292 object[name] = value; 292 frameId: frameId,
293 stackTrace: traceEvent.stackTrace,
294 startTime: record.startTime(),
295 thread: record.thread(),
296 type: record.type()
297 };
298 for (var field in object) {
299 if (object[field] === null || object[field] === undefined)
yurys 2015/09/10 00:10:16 Can we get formatters to take care of this?
300 delete object[field];
293 } 301 }
294 if (record.children().length) 302 if (record.children().length)
295 object["children"] = []; 303 object["children"] = [];
296 if (!record.data())
297 object["data"] = record.traceEvent().args;
298 InspectorTest.addObject(object, InspectorTest.timelinePropertyFormatters); 304 InspectorTest.addObject(object, InspectorTest.timelinePropertyFormatters);
299 }; 305 };
300 306
301 InspectorTest.findFirstTimelineRecord = function(type) 307 InspectorTest.findFirstTimelineRecord = function(type)
302 { 308 {
303 return InspectorTest.findTimelineRecord(type, 0); 309 return InspectorTest.findTimelineRecord(type, 0);
304 } 310 }
305 311
306 // Find the (n+1)th timeline record of a specific type. 312 // Find the (n+1)th timeline record of a specific type.
307 InspectorTest.findTimelineRecord = function(type, n) 313 InspectorTest.findTimelineRecord = function(type, n)
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 if (!--count) { 411 if (!--count) {
406 callback(); 412 callback();
407 return; 413 return;
408 } 414 }
409 if (window.testRunner) 415 if (window.testRunner)
410 testRunner.capturePixelsAsyncThen(requestAnimationFrame.bind(window, makeFrame)); 416 testRunner.capturePixelsAsyncThen(requestAnimationFrame.bind(window, makeFrame));
411 else 417 else
412 window.requestAnimationFrame(makeFrame); 418 window.requestAnimationFrame(makeFrame);
413 } 419 }
414 } 420 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/tracing/timeline-coalescing.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698