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

Unified Diff: LayoutTests/inspector/tracing.html

Issue 557013005: DevTools: extract TracingManager from TracingModel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments addressed Created 6 years, 3 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 | LayoutTests/inspector/tracing-test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/tracing.html
diff --git a/LayoutTests/inspector/tracing.html b/LayoutTests/inspector/tracing.html
index d86f24e2df5048906d9f957aa65700420259fde4..48b7e474238704de1607b5c1e5c1acb083693107 100644
--- a/LayoutTests/inspector/tracing.html
+++ b/LayoutTests/inspector/tracing.html
@@ -21,6 +21,9 @@ function test()
{
WebInspector.inspectorView.showPanel("timeline");
+ var tracingManager = new WebInspector.TracingManager();
+ var tracingModel = new WebInspector.TracingModel();
+
function runEventsSanityCheck()
{
var events = [];
@@ -61,22 +64,29 @@ function test()
function onTracingComplete()
{
- tracingModel.removeEventListener(WebInspector.TracingModel.Events.TracingComplete, onTracingComplete);
+ tracingManager.removeEventListener(WebInspector.TracingManager.Events.TracingComplete, onTracingComplete);
InspectorTest.addResult("Tracing complete");
runEventsSanityCheck();
InspectorTest.completeTest();
}
- var tracingModel = new WebInspector.TracingModel(WebInspector.targetManager.mainTarget());
- tracingModel.start("", "", onTracingStarted);
+ tracingManager.start("", "", onTracingStarted);
+ tracingManager.addEventListener(WebInspector.TracingManager.Events.EventsCollected, onEventsCollected);
+
function onTracingStarted(error)
{
InspectorTest.addResult("Tracing started (error: " + JSON.stringify(error) + ")");
+ tracingModel.reset();
InspectorTest.evaluateInPage("doWork()", function() {
- tracingModel.addEventListener(WebInspector.TracingModel.Events.TracingComplete, onTracingComplete);
- tracingModel.stop(onTracingComplete);
+ tracingManager.addEventListener(WebInspector.TracingManager.Events.TracingComplete, onTracingComplete);
+ tracingManager.stop();
});
}
+
+ function onEventsCollected(event)
+ {
+ tracingModel.addEvents(event.data);
+ }
}
</script>
« no previous file with comments | « no previous file | LayoutTests/inspector/tracing-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698