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

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

Issue 1739193003: Timeline: extract and rename TracingModelLoader into a file of its own (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/tracing/timeline-flame-chart-automatically-size-window.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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 { 380 {
381 return this._fileSize; 381 return this._fileSize;
382 }, 382 },
383 383
384 fileName: function() 384 fileName: function()
385 { 385 {
386 return "fakeFile"; 386 return "fakeFile";
387 } 387 }
388 }; 388 };
389 389
390 InspectorTest.loadTimeline = function(timelineData)
391 {
392 var timeline = WebInspector.panels.timeline;
393
394 function createFileReader(file, delegate)
395 {
396 return new InspectorTest.FakeFileReader(timelineData, delegate, timeline ._saveToFile.bind(timeline));
397 }
398
399 InspectorTest.override(WebInspector.TimelineLoader, "_createFileReader", cre ateFileReader);
400 WebInspector.TimelineLoader.loadFromFile(InspectorTest.timelineModel(), {}, new WebInspector.Progress());
401 }
402
390 }; 403 };
391 404
392 function generateFrames(count, callback) 405 function generateFrames(count, callback)
393 { 406 {
394 makeFrame(); 407 makeFrame();
395 function makeFrame() 408 function makeFrame()
396 { 409 {
397 document.body.style.backgroundColor = count & 1 ? "rgb(200, 200, 200)" : "rgb(240, 240, 240)"; 410 document.body.style.backgroundColor = count & 1 ? "rgb(200, 200, 200)" : "rgb(240, 240, 240)";
398 if (!--count) { 411 if (!--count) {
399 callback(); 412 callback();
400 return; 413 return;
401 } 414 }
402 if (window.testRunner) 415 if (window.testRunner)
403 testRunner.capturePixelsAsyncThen(requestAnimationFrame.bind(window, makeFrame)); 416 testRunner.capturePixelsAsyncThen(requestAnimationFrame.bind(window, makeFrame));
404 else 417 else
405 window.requestAnimationFrame(makeFrame); 418 window.requestAnimationFrame(makeFrame);
406 } 419 }
407 } 420 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/tracing/timeline-flame-chart-automatically-size-window.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698