Index: LayoutTests/inspector/console/console-timeline.html |
diff --git a/LayoutTests/inspector/console/console-timeline.html b/LayoutTests/inspector/console/console-timeline.html |
index adb67acb9a4f9e31bd550fcf3b2009eeea1ce022..2a9c92e7f6d15aa43d981df570fde457ebca9498 100644 |
--- a/LayoutTests/inspector/console/console-timeline.html |
+++ b/LayoutTests/inspector/console/console-timeline.html |
@@ -78,8 +78,6 @@ function startTimeline() |
function test() |
{ |
WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, eventRecorded); |
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, timelineStarted); |
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStopped, timelineStopped); |
InspectorTest.runTestSuite([ |
function testStartStopTimeline(next) |
@@ -95,7 +93,8 @@ function test() |
function testStartMultipleStopInsideEvals(next) |
{ |
var panel = WebInspector.inspectorView.panel("timeline"); |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, recordingStopped); |
+ panel._model._currentTarget = WebInspector.targetManager.mainTarget(); |
+ InspectorTest.addSniffer(panel._model._currentTarget.timelineManager, "_processBufferedEvents", next); |
InspectorTest.evaluateInPage("startMultiple()", step2); |
@@ -108,12 +107,6 @@ function test() |
{ |
InspectorTest.evaluateInPage("stopOne()", function() {}); |
} |
- |
- function recordingStopped() |
- { |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, recordingStopped); |
- next(); |
- } |
}, |
function testStopUnknown(next) |
@@ -125,7 +118,7 @@ function test() |
{ |
var panel = WebInspector.inspectorView.panel("timeline"); |
panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, recordingStarted); |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, recordingStopped); |
+ InspectorTest.addSniffer(panel._model._currentTarget.timelineManager, "_processBufferedEvents", next); |
panel._toggleTimelineButtonClicked(); |
function recordingStarted() |
@@ -138,18 +131,12 @@ function test() |
{ |
panel._toggleTimelineButtonClicked(); |
} |
- |
- function recordingStopped() |
- { |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, recordingStopped); |
- next(); |
- } |
}, |
function testStopFromPanel(next) |
{ |
var panel = WebInspector.inspectorView.panel("timeline"); |
- panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, recordingStopped); |
+ InspectorTest.addSniffer(panel._model._currentTarget.timelineManager, "_processBufferedEvents", next); |
InspectorTest.evaluateInPage("startTimeline()", step2); |
@@ -157,60 +144,42 @@ function test() |
{ |
panel._toggleTimelineButtonClicked(); |
} |
- |
- function recordingStopped() |
- { |
- panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, recordingStopped); |
- next(); |
- } |
}, |
function testRacyStart(next) |
{ |
- var panel = WebInspector.inspectorView.panel("timeline"); |
- |
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, timelineStarted); |
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStopped, timelineStopped); |
- |
- InspectorTest.evaluateInPage("startTimeline()"); |
- panel._toggleTimelineButtonClicked(); |
- |
- function timelineStarted() |
- { |
- WebInspector.timelineManager.removeEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, timelineStarted); |
- panel._toggleTimelineButtonClicked(); |
- } |
- |
- function timelineStopped() |
- { |
- WebInspector.timelineManager.removeEventListener(WebInspector.TimelineManager.EventTypes.TimelineStopped, timelineStopped); |
- setTimeout(next); // Fool listeners order so that timeline panel got this notification first. |
- } |
+ var panel = WebInspector.inspectorView.panel("timeline"); |
+ |
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, timelineStarted); |
+ InspectorTest.addSniffer(panel._model._currentTarget.timelineManager, "_processBufferedEvents", next); |
yurys
2014/07/24 16:58:37
Consider introducing event for this.
loislo
2014/07/28 14:00:05
Done.
|
+ |
+ InspectorTest.evaluateInPage("startTimeline()"); |
+ panel._toggleTimelineButtonClicked(); |
+ |
+ function timelineStarted() |
+ { |
+ WebInspector.timelineManager.removeEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, timelineStarted); |
+ panel._toggleTimelineButtonClicked(); |
+ } |
}, |
function testRacyStart2(next) |
{ |
- var panel = WebInspector.inspectorView.panel("timeline"); |
- |
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, timelineStarted); |
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStopped, timelineStopped); |
- |
- panel._toggleTimelineButtonClicked(); |
- InspectorTest.evaluateInPage("startTimeline()"); |
- |
- function timelineStarted() |
- { |
- WebInspector.timelineManager.removeEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, timelineStarted); |
- // Fool listener order execution. |
- setTimeout(panel._toggleTimelineButtonClicked.bind(panel)); |
- } |
- |
- function timelineStopped() |
- { |
- WebInspector.timelineManager.removeEventListener(WebInspector.TimelineManager.EventTypes.TimelineStopped, timelineStopped); |
- setTimeout(next); // Fool listeners order so that timeline panel got this notification first. |
- } |
- } |
+ var panel = WebInspector.inspectorView.panel("timeline"); |
+ |
+ WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, timelineStarted); |
+ InspectorTest.addSniffer(panel._model._currentTarget.timelineManager, "_processBufferedEvents", next); |
+ |
+ panel._toggleTimelineButtonClicked(); |
+ InspectorTest.evaluateInPage("startTimeline()"); |
+ |
+ function timelineStarted() |
+ { |
+ WebInspector.timelineManager.removeEventListener(WebInspector.TimelineManager.EventTypes.TimelineStarted, timelineStarted); |
+ // Fool listener order execution. |
+ setTimeout(panel._toggleTimelineButtonClicked.bind(panel)); |
+ } |
+ } |
]); |
function eventRecorded(event) |
@@ -225,16 +194,6 @@ function test() |
} |
print(event.data); |
} |
- |
- function timelineStarted(event) |
- { |
- InspectorTest.addResult("Timeline started from " + (event.data ? "console." : "panel")); |
- } |
- |
- function timelineStopped(event) |
- { |
- InspectorTest.addResult("Timeline stopped from " + (event.data ? "console." : "panel")); |
- } |
} |
</script> |