| <script src="../../http/tests/inspector/resources/inspector-test.js"></script> |
| document.getElementById("test").addEventListener("click", (event) => { |
| TestPage.addResult(window.internals.hasTransientActivation() ? "Has transient activation" : "No transient activation"); |
| let suite = InspectorTest.createAsyncSuite("Runtime.evaluate"); |
| name: "Runtime.evaluate.emulateUserGesture.hasTransientActivation.false", |
| description: "Check that the evaluation is not considered a user interaction when emulateUserGesture is false.", |
| await RuntimeAgent.evaluate.invoke({expression: `document.getElementById("test").click()`, emulateUserGesture: false}); |
| name: "Runtime.evaluate.emulateUserGesture.hasTransientActivation.true", |
| description: "Check that the evaluation is considered a user interaction when emulateUserGesture is true.", |
| await RuntimeAgent.evaluate.invoke({expression: `document.getElementById("test").click()`, emulateUserGesture: true}); |
| suite.runTestCasesAndFinish(); |
| <p>Tests for Runtime emulateUserGesture option.</p> |