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

Side by Side Diff: LayoutTests/inspector/tracing-test.js

Issue 318343003: Move trace event based implementation parts of TimelineModel into TracingTimelineModel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
OLDNEW
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698