chromium/third_party/blink/web_tests/external/wpt/html/user-activation/resources/child-one.html

<!DOCTYPE html>
<body style="background: yellow;">
  <script>
    window.top.postMessage(JSON.stringify({
        "type": "child-one-loaded",
        "isActive": navigator.userActivation.isActive,
        "hasBeenActive": navigator.userActivation.hasBeenActive
    }), "*");

    window.addEventListener("click", event => {
        window.top.postMessage(JSON.stringify({
            "type": "child-one-clicked",
            "isActive": navigator.userActivation.isActive,
            "hasBeenActive": navigator.userActivation.hasBeenActive
        }), "*");
    });

    window.addEventListener("message", event => {
        var msg = JSON.parse(event.data);
        if (msg.type == "report") {
            window.top.postMessage(JSON.stringify({
                "type": "child-one-report",
                "isActive": navigator.userActivation.isActive,
                "hasBeenActive": navigator.userActivation.hasBeenActive
            }), "*");
        }
    });
  </script>
</body>