1 function initialize_TracingTest()
4 InspectorTest.preloadPanel("timeline");
5 WebInspector.TempFile = InspectorTest.TempFileMock;
7 InspectorTest.createTracingModel = function()
9 return new WebInspector.TracingModel(new WebInspector.TempFileBackingStorage("tracing"));
12 InspectorTest.tracingModel = function()
14 return WebInspector.panels.timeline._tracingModel;
17 InspectorTest.tracingTimelineModel = function()
19 return WebInspector.panels.timeline._model;
22 InspectorTest.invokeWithTracing = function(functionName, callback, additionalCategories, enableJSSampling)
24 var categories = "-*,disabled-by-default-devtools.timeline*,devtools.timeline";
25 if (additionalCategories)
26 categories += "," + additionalCategories;
27 InspectorTest.tracingTimelineModel()._startRecordingWithCategories(categories, enableJSSampling, tracingStarted);
29 function tracingStarted()
31 InspectorTest.invokePageFunctionAsync(functionName, onPageActionsDone);
34 function onPageActionsDone()
36 InspectorTest.tracingTimelineModel().addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, onTracingComplete, this);
37 InspectorTest.tracingTimelineModel().stopRecording();
40 function onTracingComplete(event)
42 InspectorTest.tracingTimelineModel().removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, onTracingComplete, this);