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

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

Issue 2486853002: Timeline: remove TimelineModel inferred properties from TracingModel.Event (Closed)
Patch Set: addressed comments and rebased Created 4 years, 1 month 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/tracing/decode-resize.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 function wrapCallFunctionForTimeline(f) 1 function wrapCallFunctionForTimeline(f)
2 { 2 {
3 var script = document.createElement("script"); 3 var script = document.createElement("script");
4 script.textContent = "(" + f.toString() + ")()\n//# sourceURL=wrapCallFuncti onForTimeline.js"; 4 script.textContent = "(" + f.toString() + ")()\n//# sourceURL=wrapCallFuncti onForTimeline.js";
5 document.body.appendChild(script); 5 document.body.appendChild(script);
6 } 6 }
7 7
8 var initialize_Timeline = function() { 8 var initialize_Timeline = function() {
9 9
10 InspectorTest.preloadPanel("timeline"); 10 InspectorTest.preloadPanel("timeline");
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 217
218 InspectorTest.printTimelineRecordsWithDetails = function(typeName) 218 InspectorTest.printTimelineRecordsWithDetails = function(typeName)
219 { 219 {
220 function detailsFormatter(recordType, record) 220 function detailsFormatter(recordType, record)
221 { 221 {
222 if (recordType && recordType !== record.type()) 222 if (recordType && recordType !== record.type())
223 return; 223 return;
224 var event = record.traceEvent(); 224 var event = record.traceEvent();
225 InspectorTest.addResult("Text details for " + record.type() + ": " + Ins pectorTest.detailsTextForTraceEvent(event)); 225 InspectorTest.addResult("Text details for " + record.type() + ": " + Ins pectorTest.detailsTextForTraceEvent(event));
226 if (event.warning) 226 if (WebInspector.TimelineData.forEvent(event).warning)
227 InspectorTest.addResult(record.type() + " has a warning"); 227 InspectorTest.addResult(record.type() + " has a warning");
228 } 228 }
229 229
230 InspectorTest.timelineModel().forAllRecords(InspectorTest._printTimlineRecor d.bind(InspectorTest, typeName, detailsFormatter.bind(null, typeName))); 230 InspectorTest.timelineModel().forAllRecords(InspectorTest._printTimlineRecor d.bind(InspectorTest, typeName, detailsFormatter.bind(null, typeName)));
231 }; 231 };
232 232
233 InspectorTest.walkTimelineEventTree = function(callback) 233 InspectorTest.walkTimelineEventTree = function(callback)
234 { 234 {
235 var model = InspectorTest.timelineModel(); 235 var model = InspectorTest.timelineModel();
236 var view = new WebInspector.EventsTimelineTreeView(model, WebInspector.panel s.timeline._filters, null); 236 var view = new WebInspector.EventsTimelineTreeView(model, WebInspector.panel s.timeline._filters, null);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 InspectorTest.printTraceEventProperties = function(traceEvent) 333 InspectorTest.printTraceEventProperties = function(traceEvent)
334 { 334 {
335 InspectorTest.addResult(traceEvent.name + " Properties:"); 335 InspectorTest.addResult(traceEvent.name + " Properties:");
336 var data = traceEvent.args["beginData"] || traceEvent.args["data"]; 336 var data = traceEvent.args["beginData"] || traceEvent.args["data"];
337 var frameId = data && data["frame"]; 337 var frameId = data && data["frame"];
338 var object = { 338 var object = {
339 data: traceEvent.args["data"] || traceEvent.args, 339 data: traceEvent.args["data"] || traceEvent.args,
340 endTime: traceEvent.endTime || traceEvent.startTime, 340 endTime: traceEvent.endTime || traceEvent.startTime,
341 frameId: frameId, 341 frameId: frameId,
342 stackTrace: traceEvent.stackTrace, 342 stackTrace: WebInspector.TimelineData.forEvent(traceEvent).stackTrace,
343 startTime: traceEvent.startTime, 343 startTime: traceEvent.startTime,
344 type: traceEvent.name, 344 type: traceEvent.name,
345 }; 345 };
346 for (var field in object) { 346 for (var field in object) {
347 if (object[field] === null || object[field] === undefined) 347 if (object[field] === null || object[field] === undefined)
348 delete object[field]; 348 delete object[field];
349 } 349 }
350 InspectorTest.addObject(object, InspectorTest.timelinePropertyFormatters); 350 InspectorTest.addObject(object, InspectorTest.timelinePropertyFormatters);
351 }; 351 };
352 352
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 value = Number(value.toFixed(7)); 397 value = Number(value.toFixed(7));
398 else if (typeof value === "object" && value) 398 else if (typeof value === "object" && value)
399 value = formatFields(value); 399 value = formatFields(value);
400 result[key] = value; 400 result[key] = value;
401 } 401 }
402 return result; 402 return result;
403 } 403 }
404 InspectorTest.addObject(formatFields(frame)); 404 InspectorTest.addObject(formatFields(frame));
405 } 405 }
406 406
407 InspectorTest.dumpInvalidations = function(recordType, index, comment)
408 {
409 var record = InspectorTest.findTimelineRecord(recordType, index || 0);
410 InspectorTest.addArray(WebInspector.InvalidationTracker.invalidationEventsFo r(record._event), InspectorTest.InvalidationFormatters, "", comment);
411 }
412
407 InspectorTest.FakeFileReader.prototype = { 413 InspectorTest.FakeFileReader.prototype = {
408 start: function(output) 414 start: function(output)
409 { 415 {
410 this._delegate.onTransferStarted(this); 416 this._delegate.onTransferStarted(this);
411 417
412 var length = this._input.length; 418 var length = this._input.length;
413 var half = (length + 1) >> 1; 419 var half = (length + 1) >> 1;
414 420
415 var chunk = this._input.substring(0, half); 421 var chunk = this._input.substring(0, half);
416 this._loadedSize += chunk.length; 422 this._loadedSize += chunk.length;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 function waitForFrame() 484 function waitForFrame()
479 { 485 {
480 var callback; 486 var callback;
481 var promise = new Promise((fulfill) => callback = fulfill); 487 var promise = new Promise((fulfill) => callback = fulfill);
482 if (window.testRunner) 488 if (window.testRunner)
483 testRunner.capturePixelsAsyncThen(() => window.requestAnimationFrame(cal lback)); 489 testRunner.capturePixelsAsyncThen(() => window.requestAnimationFrame(cal lback));
484 else 490 else
485 window.requestAnimationFrame(callback); 491 window.requestAnimationFrame(callback);
486 return promise; 492 return promise;
487 } 493 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/tracing/decode-resize.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698