| <script src="../../http/tests/inspector/resources/inspector-test.js"></script> |
| let suite = InspectorTest.createAsyncSuite("Runtime.evaluate.emulateUserGesture"); |
| name: "EvaluateWithoutEmulatingUserGesture", |
| description: "Evalute with the emulateUserGesture option set to false.", |
| RuntimeAgent.evaluate.invoke({expression: `document.getElementById("foo").click()`, objectGroup: "test", emulateUserGesture: false}, (error) => { |
| InspectorTest.assert(!error, "Should not be a protocol error."); |
| name: "EvaluateWithEmulatingUserGesture", |
| description: "Evalute with the emulateUserGesture option set to true.", |
| RuntimeAgent.evaluate.invoke({expression: `document.getElementById("foo").click()`, objectGroup: "test", emulateUserGesture: true}, (error) => { |
| InspectorTest.assert(!error, "Should not be a protocol error."); |
| suite.runTestCasesAndFinish(); |
| function handleClick(event) { |
| TestPage.addResult(window.internals.isProcessingUserGesture() ? "In User Gesture" : "Not in User Gesture"); |
| window.addEventListener("load", function () { |
| document.getElementById("foo").addEventListener("click", handleClick); |
| <p>Tests for Runtime emulateUserGesture option.</p> |