OLD | NEW |
1 function initialize_TracingTest() | 1 function initialize_TracingTest() |
2 { | 2 { |
3 | 3 |
4 // FIXME: remove when tracing is out of experimental | 4 // FIXME: remove when tracing is out of experimental |
5 WebInspector.inspectorView.showPanel("timeline"); | 5 WebInspector.inspectorView.showPanel("timeline"); |
6 InspectorTest.tracingModel = new WebInspector.TracingModel(); | 6 InspectorTest.tracingModel = new WebInspector.TracingModel(); |
| 7 InspectorTest.tracingTimelineModel = new WebInspector.TracingTimelineModel(Inspe
ctorTest.tracingModel); |
7 | 8 |
8 InspectorTest.invokeWithTracing = function(categoryFilter, functionName, callbac
k) | 9 InspectorTest.invokeWithTracing = function(categoryFilter, functionName, callbac
k) |
9 { | 10 { |
10 InspectorTest.tracingModel.start(categoryFilter, "", onTracingStarted); | 11 InspectorTest.tracingTimelineModel.addEventListener(WebInspector.TimelineMod
el.Events.RecordingStarted, onTracingStarted, this); |
| 12 InspectorTest.tracingTimelineModel._startRecordingWithCategories(categoryFil
ter); |
11 | 13 |
12 function onTracingStarted(error) | 14 function onTracingStarted(event) |
13 { | 15 { |
| 16 InspectorTest.tracingTimelineModel.removeEventListener(WebInspector.Time
lineModel.Events.RecordingStarted, onTracingStarted, this); |
14 InspectorTest.invokePageFunctionAsync(functionName, onPageActionsDone); | 17 InspectorTest.invokePageFunctionAsync(functionName, onPageActionsDone); |
15 } | 18 } |
16 | 19 |
17 function onPageActionsDone() | 20 function onPageActionsDone() |
18 { | 21 { |
19 InspectorTest.tracingModel.stop(InspectorTest.safeWrap(callback)); | 22 InspectorTest.tracingTimelineModel.addEventListener(WebInspector.Timelin
eModel.Events.RecordingStopped, onTracingComplete, this); |
| 23 InspectorTest.tracingTimelineModel.stopRecording(); |
| 24 } |
| 25 |
| 26 function onTracingComplete(event) |
| 27 { |
| 28 InspectorTest.tracingTimelineModel.removeEventListener(WebInspector.Time
lineModel.Events.RecordingStopped, onTracingComplete, this); |
| 29 callback(); |
20 } | 30 } |
21 } | 31 } |
22 | 32 |
23 } | 33 } |
OLD | NEW |