Index: LayoutTests/inspector/tracing/console-timeline.html |
diff --git a/LayoutTests/inspector/console/console-timeline.html b/LayoutTests/inspector/tracing/console-timeline.html |
similarity index 67% |
copy from LayoutTests/inspector/console/console-timeline.html |
copy to LayoutTests/inspector/tracing/console-timeline.html |
index 5cac295369c3df98b6c1641e8674616c5c5a8cc3..be56bfc31a6e7449c392eb0eb9a94d09883faa1e 100644 |
--- a/LayoutTests/inspector/console/console-timeline.html |
+++ b/LayoutTests/inspector/tracing/console-timeline.html |
@@ -80,38 +80,38 @@ function test() |
WebInspector.inspectorView.showPanel("timeline"); |
var panel = WebInspector.inspectorView.panel("timeline"); |
panel._model._currentTarget = WebInspector.targetManager.mainTarget(); |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, eventRecorded, this); |
InspectorTest.runTestSuite([ |
function testStartStopTimeline(next) |
{ |
- InspectorTest.evaluateInPage("startStopTimeline()"); |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, allEventsReceived, this); |
+ InspectorTest.evaluateWithTimeline("startStopTimeline()", allEventsReceived); |
function allEventsReceived() |
{ |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, allEventsReceived, this); |
+ printTimelineAndTimestampEvents(); |
next(); |
} |
}, |
function testStartStopMultiple(next) |
{ |
- InspectorTest.evaluateInPage("startStopMultiple()"); |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, allEventsReceived, this); |
+ InspectorTest.evaluateWithTimeline("startStopMultiple()", allEventsReceived); |
function allEventsReceived() |
{ |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, allEventsReceived, this); |
+ printTimelineAndTimestampEvents(); |
next(); |
} |
}, |
function testStartMultipleStopInsideEvals(next) |
{ |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish, this); |
+ InspectorTest.startTimeline(step1); |
- InspectorTest.evaluateInPage("startMultiple()", step2); |
+ function step1() |
+ { |
+ InspectorTest.evaluateInPage("startMultiple()", step2); |
+ } |
function step2() |
{ |
@@ -120,25 +120,36 @@ function test() |
function step3() |
{ |
- InspectorTest.evaluateInPage("stopOne()", function() {}); |
+ InspectorTest.evaluateInPage("stopOne()", step4); |
+ } |
+ |
+ function step4() |
+ { |
+ InspectorTest.stopTimeline(finish); |
} |
function finish() |
{ |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish, this); |
+ printTimelineAndTimestampEvents(); |
next(); |
} |
- }, |
+ }, |
function testStopUnknown(next) |
{ |
- InspectorTest.evaluateInPage("stopUnknown()", next); |
+ InspectorTest.evaluateWithTimeline("stopUnknown()", allEventsReceived); |
+ |
+ function allEventsReceived() |
+ { |
+ printTimelineAndTimestampEvents(); |
+ next(); |
+ } |
}, |
function testStartFromPanel(next) |
{ |
panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, recordingStarted); |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish, this); |
+ panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish); |
panel._toggleTimelineButtonClicked(); |
function recordingStarted() |
@@ -154,16 +165,22 @@ function test() |
function finish() |
{ |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish, this); |
+ printTimelineAndTimestampEvents(); |
+ panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish); |
next(); |
} |
}, |
function testStopFromPanel(next) |
{ |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish, this); |
+ panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish); |
+ |
+ InspectorTest.startTimeline(step1); |
- InspectorTest.evaluateInPage("startTimeline()", step2); |
+ function step1() |
+ { |
+ InspectorTest.evaluateInPage("startTimeline()", step2); |
+ } |
function step2() |
{ |
@@ -172,66 +189,67 @@ function test() |
function finish() |
{ |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish, this); |
+ printTimelineAndTimestampEvents(); |
+ panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish); |
next(); |
} |
}, |
function testRacyStart(next) |
{ |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, timelineStarted); |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish, this); |
- |
- InspectorTest.evaluateInPage("startTimeline()"); |
+ panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish); |
+ InspectorTest.evaluateInPage("startTimeline()", timelineStarted); |
panel._toggleTimelineButtonClicked(); |
function timelineStarted() |
{ |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStarted, timelineStarted); |
panel._toggleTimelineButtonClicked(); |
} |
function finish() |
{ |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish, this); |
+ printTimelineAndTimestampEvents(); |
+ panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish); |
next(); |
} |
}, |
function testRacyStart2(next) |
{ |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, timelineStarted); |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish, this); |
+ panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish); |
panel._toggleTimelineButtonClicked(); |
- InspectorTest.evaluateInPage("startTimeline()"); |
+ InspectorTest.evaluateInPage("startTimeline()", timelineStarted); |
function timelineStarted() |
{ |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStarted, timelineStarted); |
// Fool listener order execution. |
setTimeout(panel._toggleTimelineButtonClicked.bind(panel)); |
} |
function finish() |
{ |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish, this); |
+ panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, finish); |
+ printTimelineAndTimestampEvents(); |
next(); |
} |
} |
]); |
- function eventRecorded(event) |
- { |
- function print(record) |
+ function printTimelineAndTimestampEvents() { |
+ panel._tracingModel.sortedProcesses().forEach(function(process) |
{ |
- if (record.type() === "TimeStamp") |
- InspectorTest.addResult(record.data().message); |
- |
- for (var i = 0; i < record.children().length; ++i) |
- print(record.children()[i]); |
- } |
- print(event.data); |
+ process.sortedThreads().forEach(function(thread) |
+ { |
+ thread.events().forEach(function(event) |
+ { |
+ if (event.category === WebInspector.TracingModel.ConsoleEventCategory) |
+ InspectorTest.addResult(event.name); |
+ else if (event.name === WebInspector.TracingTimelineModel.RecordType.TimeStamp) |
+ InspectorTest.addResult(event.args["data"]["message"]); |
+ }); |
+ }); |
+ }); |
} |
} |