Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector-protocol / timeline / timeline-start-bufferEvents.html
index 767e7d3..3a4e476 100644 (file)
@@ -6,26 +6,27 @@
 function testFunction()
 {
     console.timeStamp("Timestamp");
-    setTimeout(function() {
-        console.timeStamp("Timestamp in timer");
-    });
 }
 
 function test()
 {
     InspectorTest.eventHandler["Timeline.eventRecorded"] = eventRecorded;
     InspectorTest.log("Recording started");
-    InspectorTest.sendCommand("Timeline.start", { bufferEvents: true, liveEvents: "TimerFire" }, onStart);
+    InspectorTest.sendCommand("Timeline.start", { bufferEvents: true }, onStart);
 
     function onStart(response)
     {
-        InspectorTest.sendCommand("Runtime.evaluate", { "expression": "testFunction()" });
+        InspectorTest.sendCommand("Runtime.evaluate", { "expression": "testFunction()" }, didEvaluate);
     }
 
-    function eventRecorded(event)
+    function didEvaluate(response)
     {
         InspectorTest.sendCommand("Timeline.stop", {}, onStop);
-        InspectorTest.log("    Event recorded: " + event.params.record.type);
+    }
+
+    function eventRecorded(event)
+    {
+        InspectorTest.log("FAIL: event recorded: " + event.params.record.type);
     }
 
     function onStop(response)
@@ -41,9 +42,8 @@ function test()
     function dump(event, prefix)
     {
         var eventTypes = { "FunctionCall":true, "TimeStamp":true, "TimerInstall":true, "TimerFire":true };
-        if (!(event.type in eventTypes))
-            return;
-        InspectorTest.log(prefix + event.type);
+        if (event.type in eventTypes)
+            InspectorTest.log(prefix + event.type);
         for (var i = 0; event.children && i < event.children.length; ++i)
             dump(event.children[i], "    " + prefix);
     }