3 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
4 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/tracing-test.js"></script>
7 function performActions(callback
)
9 var timerId
= setTimeout(function()
11 evaluateInFrontend("InspectorTest.testFunctionTimerFired(" + timerId
+ ", " + timerId2
+ ")");
15 var timerId2
= setTimeout(function() { }, 0);
16 clearTimeout(timerId2
);
22 InspectorTest
.invokeAsyncWithTracing("performActions", finish
);
26 InspectorTest
.testFunctionTimerFired = function(timerId1
, timerId2
)
28 firedTimerId
= timerId1
;
29 removedTimerId
= timerId2
;
30 InspectorTest
.log("SUCCESS: testFunctionTimerFired");
33 function finish(devtoolsEvents
)
35 function hasTimerId(id
, e
) { return e
.args
.data
.timerId
=== id
}
37 var installTimer1
= InspectorTest
.findEvent("TimerInstall", "I", hasTimerId
.bind(this, firedTimerId
));
38 var installTimer2
= InspectorTest
.findEvent("TimerInstall", "I", hasTimerId
.bind(this, removedTimerId
));
40 InspectorTest
.log("TimerInstall has frame: " + !!installTimer1
.args
.data
.frame
);
41 InspectorTest
.log("TimerInstall frames match: " + (installTimer1
.args
.data
.frame
=== installTimer2
.args
.data
.frame
));
43 InspectorTest
.findEvent("TimerRemove", "I", hasTimerId
.bind(this, removedTimerId
));
44 InspectorTest
.findEvent("TimerFire", "X", hasTimerId
.bind(this, firedTimerId
));
46 InspectorTest
.log("SUCCESS: found all expected events.");
47 InspectorTest
.completeTest();
52 <body onLoad=
"runTest();">
53 <div id=
"myDiv">DIV
</div>