summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/user-activation/resources/consumption-crossorigin-child.sub.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/user-activation/resources/consumption-crossorigin-child.sub.html')
-rw-r--r--testing/web-platform/tests/html/user-activation/resources/consumption-crossorigin-child.sub.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/user-activation/resources/consumption-crossorigin-child.sub.html b/testing/web-platform/tests/html/user-activation/resources/consumption-crossorigin-child.sub.html
new file mode 100644
index 0000000000..518e000d0b
--- /dev/null
+++ b/testing/web-platform/tests/html/user-activation/resources/consumption-crossorigin-child.sub.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script>
+ window.top.postMessage(JSON.stringify({
+ "type": "child-crossorigin-loaded",
+ "isActive": navigator.userActivation.isActive,
+ "hasBeenActive": navigator.userActivation.hasBeenActive
+ }), "*");
+
+ window.addEventListener("click", event => {
+ window.open().close();
+
+ window.top.postMessage(JSON.stringify({
+ "type": "child-crossorigin-report",
+ "isActive": navigator.userActivation.isActive,
+ "hasBeenActive": navigator.userActivation.hasBeenActive
+ }), "*");
+ });
+ </script>
+</head>
+<body style="background: lightgreen;">
+ <!-- The midpoint of this frame should be outside the grandchild frame. -->
+ <div style="height: 75px;">Cross-origin child frame</div>
+ <iframe id="child2" width="270px" height="30px"
+ src="http://{{hosts[][]}}:{{ports[http][1]}}/html/user-activation/resources/child-two.html">
+ </iframe>
+</body>
+</html>