| <!DOCTYPE html> |
| <!-- |
| Tentative due to: |
| https://github.com/whatwg/html/issues/1903 |
| --> |
| <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> |
| </head> |
| <body> |
| <h1>Activation state is visible in parent and not in child</h1> |
| <ol id="instructions"> |
| <li>Click anywhere on the green area (child frame). |
| </ol> |
| <iframe id="child" width="400" height="400"></iframe> |
| <script> |
| async_test(function(t) { |
| assert_false(navigator.userActivation.isActive); |
| assert_false(navigator.userActivation.hasBeenActive); |
| |
| let child = document.getElementById("child"); |
| |
| window.addEventListener("message", t.step_func(event => { |
| if (event.source === frames[0].frames[0] && event.data === 'checked') { |
| // Parent should be active after child is clicked. |
| assert_true(navigator.userActivation.isActive); |
| assert_true(navigator.userActivation.hasBeenActive); |
| t.done(); |
| } |
| })); |
| child.src = "http://{{domains[www1]}}:{{ports[http][0]}}/html/user-activation/resources/activation-hierarchy-child.sub.html"; |
| }, "Parent test"); |
| </script> |
| </body> |
| </html> |