Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / timeline / timeline-auto-record.html
index 2d9f8a5..6140c1f 100644 (file)
@@ -8,27 +8,33 @@ function test()
 {
     var panel = WebInspector.inspectorView.panel("timeline");
     var model = panel._model;
-    InspectorTest.assertTrue(!model._clientInitiatedRecording, "timeline is being recorded");
-    InspectorTest.assertTrue(!model.records().length, "timeline has already been recorded");
+
+    model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, recordingStarted);
+    model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, recordingStopped);
 
     WebInspector.inspectorView.showPanel("console");
     InspectorTest.runWhenPageLoads(step1);
+    InspectorTest.addResult("Reloading page on console panel");
     WebInspector.resourceTreeModel.reloadPage();
 
+
     function step1()
     {
-        InspectorTest.assertTrue(!model._clientInitiatedRecording, "timeline started recording");
-        InspectorTest.assertTrue(!model.records().length, "timeline has been recorded");
-
         WebInspector.inspectorView.showPanel("timeline");
-        InspectorTest.runWhenPageLoads(step2);
+        InspectorTest.runWhenPageLoads(function() {});
+        InspectorTest.addResult("Reloading page on timeline panel");
         WebInspector.resourceTreeModel.reloadPage();
     }
 
-    function step2()
+    function recordingStarted()
+    {
+        InspectorTest.addResult("Recording started");
+        InspectorTest.addResult("Initiated by user: " + model._clientInitiatedRecording);
+    }
+
+    function recordingStopped()
     {
-        InspectorTest.assertTrue(model.records().length, "timeline should have been recorded");
-        InspectorTest.assertTrue(!model._clientInitiatedRecording, "timeline recording should have finished");
+        InspectorTest.addResult("Recording stopped");
         InspectorTest.completeTest();
     }
 }