blob: c23af040398f0005cee0df5cdde693316e9918cf [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.Tracking");
suite.addTestCase({
name: "ScriptProfiler.Tracking.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>