summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/user-activation/resources/child-one.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/user-activation/resources/child-one.html')
-rw-r--r--testing/web-platform/tests/html/user-activation/resources/child-one.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/user-activation/resources/child-one.html b/testing/web-platform/tests/html/user-activation/resources/child-one.html
new file mode 100644
index 0000000000..9668372620
--- /dev/null
+++ b/testing/web-platform/tests/html/user-activation/resources/child-one.html
@@ -0,0 +1,29 @@
+<!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>