| <!DOCTYPE html> |
| <html> |
| <head> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src="/resources/testdriver.js"></script> |
| <script src="/resources/testdriver-vendor.js"></script> |
| <script> |
| function runTest() { |
| promise_test(async (t) => { |
| const { userActivation } = navigator; |
| assert_false(userActivation.isActive, "isActive must be false"); |
| assert_false(userActivation.hasBeenActive, "userActivation must be false"); |
| |
| await test_driver.click(document.body); |
| |
| for (let depth = 1; depth <= 3; depth++) { |
| await new Promise((resolve) => { |
| t.step_timeout(resolve, 10); |
| }); |
| assert_true(userActivation.isActive, "isActive must be true"); |
| assert_true(userActivation.hasBeenActive, "hasBeenActive must be true"); |
| } |
| }, "Chained setTimeout test"); |
| } |
| </script> |
| <body onload="runTest()"> |
| <h1>User activation state in chained setTimeout calls</h1> |
| <p> |
| Tests that user activation state is visible in arbitrary call depth of |
| setTimeout. |
| </p> |
| </body> |
| </html> |