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)
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);
}