| <script src="../../http/tests/inspector/resources/protocol-test.js"></script> |
| let suite = ProtocolTest.createAsyncSuite("ScriptProfiler.Tracking"); |
| name: "ScriptProfiler.Tracking.StartAndStopTracking", |
| description: "Start and stop the ScriptProfiler should cause trackingStart and trackingComplete events.", |
| 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"); |
| InspectorProtocol.sendCommand("ScriptProfiler.startTracking", {}); |
| InspectorProtocol.sendCommand("ScriptProfiler.stopTracking", {}); |
| suite.runTestCasesAndFinish(); |
| <body onload="runTest()"> |
| <p>Tests that ScriptProfiler.startTracking and ScriptProfiler.stopTracking trigger trackingStart and trackingComplete events.</p> |