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

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

Issue 480003002: Start timeline recording using TimelinePanel methods instead of agent methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 // Scrub values when printing out these properties in the record or data field. 3 // Scrub values when printing out these properties in the record or data field.
4 InspectorTest.timelinePropertyFormatters = { 4 InspectorTest.timelinePropertyFormatters = {
5 children: "formatAsTypeName", 5 children: "formatAsTypeName",
6 endTime: "formatAsTypeName", 6 endTime: "formatAsTypeName",
7 requestId: "formatAsTypeName", 7 requestId: "formatAsTypeName",
8 startTime: "formatAsTypeName", 8 startTime: "formatAsTypeName",
9 stackTrace: "formatAsTypeName", 9 stackTrace: "formatAsTypeName",
10 url: "formatAsURL", 10 url: "formatAsURL",
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 InspectorTest.timelineModel = function() 36 InspectorTest.timelineModel = function()
37 { 37 {
38 return WebInspector.panels.timeline._model; 38 return WebInspector.panels.timeline._model;
39 } 39 }
40 40
41 InspectorTest.startTimeline = function(callback) 41 InspectorTest.startTimeline = function(callback)
42 { 42 {
43 var panel = WebInspector.inspectorView.panel("timeline"); 43 var panel = WebInspector.inspectorView.panel("timeline");
44 panel.toggleTimelineButton.toggled = true; 44 function onRecordingStarted()
45 panel._model._collectionEnabled = true; 45 {
46 panel._userInitiatedRecording = true; 46 panel._model.removeEventListener(WebInspector.TimelineModel.Events.Recor dingStarted, onRecordingStarted, this)
47 panel._model._currentTarget = WebInspector.targetManager.mainTarget(); 47 callback();
48 TimelineAgent.start(5, true, undefined, true, false, callback); 48 }
49 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingSta rted, onRecordingStarted, this)
50 panel.toggleTimelineButton.element.click();
49 }; 51 };
50 52
51 InspectorTest.stopTimeline = function(callback) 53 InspectorTest.stopTimeline = function(callback)
52 { 54 {
53 function didStop(error) 55 var panel = WebInspector.inspectorView.panel("timeline");
56 function didStop()
54 { 57 {
55 if (error) 58 panel._model.removeEventListener(WebInspector.TimelineModel.Events.Recor dingStopped, didStop, this)
56 testRunner.logToStderr("error: " + error);
57 var panel = WebInspector.inspectorView.panel("timeline");
58 panel.toggleTimelineButton.toggled = false;
59 panel._userInitiatedRecording = false;
60 callback(); 59 callback();
61 } 60 }
62 TimelineAgent.stop(didStop); 61 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingSto pped, didStop, this)
62 panel.toggleTimelineButton.element.click();
63 }; 63 };
64 64
65 InspectorTest.evaluateWithTimeline = function(actions, doneCallback) 65 InspectorTest.evaluateWithTimeline = function(actions, doneCallback)
66 { 66 {
67 InspectorTest.startTimeline(step1); 67 InspectorTest.startTimeline(step1);
68 function step1() 68 function step1()
69 { 69 {
70 InspectorTest.evaluateInPage(actions, step2); 70 InspectorTest.evaluateInPage(actions, step2);
71 } 71 }
72 72
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 return this._fileSize; 332 return this._fileSize;
333 }, 333 },
334 334
335 fileName: function() 335 fileName: function()
336 { 336 {
337 return "fakeFile"; 337 return "fakeFile";
338 } 338 }
339 }; 339 };
340 340
341 }; 341 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698