37 lines
1.4 KiB
HTML
37 lines
1.4 KiB
HTML
<!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>
|