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

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

Issue 713913002: DevTools: merge TracingTimelineUIUtils into TimelineUIUtils (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Deleted instance refs Created 6 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 | Annotate | Revision Log
« 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 4
5 // Scrub values when printing out these properties in the record or data field. 5 // Scrub values when printing out these properties in the record or data field.
6 InspectorTest.timelinePropertyFormatters = { 6 InspectorTest.timelinePropertyFormatters = {
7 children: "formatAsTypeName", 7 children: "formatAsTypeName",
8 endTime: "formatAsTypeName", 8 endTime: "formatAsTypeName",
9 requestId: "formatAsTypeName", 9 requestId: "formatAsTypeName",
10 startTime: "formatAsTypeName", 10 startTime: "formatAsTypeName",
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 InspectorTest.timelineModel = function() 48 InspectorTest.timelineModel = function()
49 { 49 {
50 return WebInspector.panels.timeline._model; 50 return WebInspector.panels.timeline._model;
51 } 51 }
52 52
53 InspectorTest.timelineFrameModel = function() 53 InspectorTest.timelineFrameModel = function()
54 { 54 {
55 return WebInspector.panels.timeline._frameModel(); 55 return WebInspector.panels.timeline._frameModel();
56 } 56 }
57 57
58 InspectorTest.timelineUIUtils = function()
59 {
60 return WebInspector.panels.timeline._uiUtils;
61 }
62
63 InspectorTest.startTimeline = function(callback) 58 InspectorTest.startTimeline = function(callback)
64 { 59 {
65 var panel = WebInspector.panels.timeline; 60 var panel = WebInspector.panels.timeline;
66 function onRecordingStarted() 61 function onRecordingStarted()
67 { 62 {
68 panel._model.removeEventListener(WebInspector.TimelineModel.Events.Recor dingStarted, onRecordingStarted, this) 63 panel._model.removeEventListener(WebInspector.TimelineModel.Events.Recor dingStarted, onRecordingStarted, this)
69 callback(); 64 callback();
70 } 65 }
71 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingSta rted, onRecordingStarted, this) 66 panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingSta rted, onRecordingStarted, this)
72 panel.toggleTimelineButton.element.click(); 67 panel.toggleTimelineButton.element.click();
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 { 174 {
180 if (typeof level !== "number") 175 if (typeof level !== "number")
181 level = 0; 176 level = 0;
182 var message = ""; 177 var message = "";
183 for (var i = 0; i < level ; ++i) 178 for (var i = 0; i < level ; ++i)
184 message = "----" + message; 179 message = "----" + message;
185 if (level > 0) 180 if (level > 0)
186 message = message + "> "; 181 message = message + "> ";
187 if (record.type() === WebInspector.TimelineModel.RecordType.TimeStamp 182 if (record.type() === WebInspector.TimelineModel.RecordType.TimeStamp
188 || record.type() === WebInspector.TimelineModel.RecordType.ConsoleTime) { 183 || record.type() === WebInspector.TimelineModel.RecordType.ConsoleTime) {
189 message += InspectorTest.timelineUIUtils().titleForRecord(record); 184 message += WebInspector.TimelineUIUtils.titleForRecord(record);
190 } else { 185 } else {
191 message += record.type(); 186 message += record.type();
192 } 187 }
193 if (detailsCallback) 188 if (detailsCallback)
194 message += " " + detailsCallback(record); 189 message += " " + detailsCallback(record);
195 InspectorTest.addResult(message); 190 InspectorTest.addResult(message);
196 191
197 var children = record.children(); 192 var children = record.children();
198 var numChildren = children.length; 193 var numChildren = children.length;
199 for (var i = 0; i < numChildren; ++i) { 194 for (var i = 0; i < numChildren; ++i) {
(...skipping 29 matching lines...) Expand all
229 for (var i = 0; i < level ; ++i) 224 for (var i = 0; i < level ; ++i)
230 message = "----" + message; 225 message = "----" + message;
231 if (level > 0) 226 if (level > 0)
232 message = message + "> "; 227 message = message + "> ";
233 if (!record) { 228 if (!record) {
234 message += "Root"; 229 message += "Root";
235 } else if (presentationRecord.coalesced()) { 230 } else if (presentationRecord.coalesced()) {
236 message += record.type() + " x " + presentationRecord.presentationChildr en().length; 231 message += record.type() + " x " + presentationRecord.presentationChildr en().length;
237 } else if (record.type() === WebInspector.TimelineModel.RecordType.TimeStamp 232 } else if (record.type() === WebInspector.TimelineModel.RecordType.TimeStamp
238 || record.type() === WebInspector.TimelineModel.RecordType.ConsoleTime) { 233 || record.type() === WebInspector.TimelineModel.RecordType.ConsoleTime) {
239 message += InspectorTest.timelineUIUtils().titleForRecord(record); 234 message += WebInspector.TimelineUIUtils.titleForRecord(record);
240 } else { 235 } else {
241 message += record.type(); 236 message += record.type();
242 } 237 }
243 if (detailsCallback) 238 if (detailsCallback)
244 message += " " + detailsCallback(presentationRecord); 239 message += " " + detailsCallback(presentationRecord);
245 InspectorTest.addResult(message); 240 InspectorTest.addResult(message);
246 241
247 var numChildren = presentationRecord.presentationChildren() ? presentationRe cord.presentationChildren().length : 0; 242 var numChildren = presentationRecord.presentationChildren() ? presentationRe cord.presentationChildren().length : 0;
248 for (var i = 0; i < numChildren; ++i) { 243 for (var i = 0; i < numChildren; ++i) {
249 if (filterTypes && filterTypes.indexOf(presentationRecord.presentationCh ildren()[i].record().type()) == -1) 244 if (filterTypes && filterTypes.indexOf(presentationRecord.presentationCh ildren()[i].record().type()) == -1)
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 return this._fileSize; 361 return this._fileSize;
367 }, 362 },
368 363
369 fileName: function() 364 fileName: function()
370 { 365 {
371 return "fakeFile"; 366 return "fakeFile";
372 } 367 }
373 }; 368 };
374 369
375 }; 370 };
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