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

Unified Diff: LayoutTests/http/tests/inspector/timeline-test.js

Issue 480003002: Start timeline recording using TimelinePanel methods instead of agent methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/inspector/timeline-test.js
diff --git a/LayoutTests/http/tests/inspector/timeline-test.js b/LayoutTests/http/tests/inspector/timeline-test.js
index d6c5ccd5776d3bcb7d10e496bbad567980365f10..de0d9fb33e3351077767cf019d9bcf2bb42d60e6 100644
--- a/LayoutTests/http/tests/inspector/timeline-test.js
+++ b/LayoutTests/http/tests/inspector/timeline-test.js
@@ -41,25 +41,25 @@ InspectorTest.timelineModel = function()
InspectorTest.startTimeline = function(callback)
{
var panel = WebInspector.inspectorView.panel("timeline");
- panel.toggleTimelineButton.toggled = true;
- panel._model._collectionEnabled = true;
- panel._userInitiatedRecording = true;
- panel._model._currentTarget = WebInspector.targetManager.mainTarget();
- TimelineAgent.start(5, true, undefined, true, false, callback);
+ function onRecordingStarted()
+ {
+ panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStarted, onRecordingStarted, this)
+ callback();
+ }
+ panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, onRecordingStarted, this)
+ panel.toggleTimelineButton.element.click();
};
InspectorTest.stopTimeline = function(callback)
{
- function didStop(error)
+ var panel = WebInspector.inspectorView.panel("timeline");
+ function didStop()
{
- if (error)
- testRunner.logToStderr("error: " + error);
- var panel = WebInspector.inspectorView.panel("timeline");
- panel.toggleTimelineButton.toggled = false;
- panel._userInitiatedRecording = false;
+ panel._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped, didStop, this)
callback();
}
- TimelineAgent.stop(didStop);
+ panel._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, didStop, this)
+ panel.toggleTimelineButton.element.click();
};
InspectorTest.evaluateWithTimeline = function(actions, doneCallback)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698