Chromium Code Reviews| 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..5f0878ff558b9c7fe1d552bc57b64715b46ad75c 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,7 @@ function test() |
| function testStartMultipleStopInsideEvals(next) |
| { |
| var panel = WebInspector.inspectorView.panel("timeline"); |
| - panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, recordingStopped); |
| + InspectorTest.addSniffer(panel._model._timelineManager, "_processBufferedEvents", next); |
|
yurys
2014/07/17 10:42:24
Can we use an event for this?
|
| InspectorTest.evaluateInPage("startMultiple()", step2); |
| @@ -108,12 +106,6 @@ function test() |
| { |
| InspectorTest.evaluateInPage("stopOne()", function() {}); |
| } |
| - |
| - function recordingStopped() |
| - { |
| - panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, recordingStopped); |
| - next(); |
| - } |
| }, |
| function testStopUnknown(next) |
| @@ -125,7 +117,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._timelineManager, "_processBufferedEvents", next); |
| panel._toggleTimelineButtonClicked(); |
| function recordingStarted() |
| @@ -138,18 +130,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._timelineManager, "_processBufferedEvents", next); |
| InspectorTest.evaluateInPage("startTimeline()", step2); |
| @@ -157,60 +143,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._timelineManager, "_processBufferedEvents", next); |
| + |
| + 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._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 +193,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> |