blob: dfa097f9330c50e8bfa95e681f2503fec241c70b [file] [log] [blame]
<!doctype html>
<html>
<head>
<script src="../../http/tests/inspector/resources/protocol-test.js"></script>
<script>
function test()
{
let suite = ProtocolTest.createAsyncSuite("ScriptProfiler.startTracking and ScriptProfiler.stopTracking");
suite.addTestCase({
name: "StartAndStopTracking",
description: "Start and stop the ScriptProfiler should cause trackingStart and trackingComplete events.",
test(resolve, reject) {
InspectorProtocol.awaitEvent({event: "ScriptProfiler.trackingStart"}).then((messageObject) => {
ProtocolTest.log("ScriptProfiler.trackingStart");
ProtocolTest.expectThat(typeof messageObject.params.timestamp === "number", "Should have a timestamp when starting.");
});
InspectorProtocol.awaitEvent({event: "ScriptProfiler.trackingComplete"}).then((messageObject) => {
ProtocolTest.log("ScriptProfiler.trackingComplete");
resolve();
});
InspectorProtocol.sendCommand("ScriptProfiler.startTracking", {});
InspectorProtocol.sendCommand("ScriptProfiler.stopTracking", {});
}
});
suite.runTestCasesAndFinish();
}
</script>
</head>
<body onload="runTest()">
<p>Tests that ScriptProfiler.startTracking and ScriptProfiler.stopTracking trigger trackingStart and trackingComplete events.</p>
</body>
</html>