summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/web-locks/resources/partitioned-parent.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/web-locks/resources/partitioned-parent.html')
-rw-r--r--testing/web-platform/tests/web-locks/resources/partitioned-parent.html24
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/web-platform/tests/web-locks/resources/partitioned-parent.html b/testing/web-platform/tests/web-locks/resources/partitioned-parent.html
new file mode 100644
index 0000000000..5dafce4965
--- /dev/null
+++ b/testing/web-platform/tests/web-locks/resources/partitioned-parent.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<meta charset="utf-8"/>
+<meta name="referrer" content="origin">
+<script>
+async function onLoad() {
+ self.addEventListener('message', evt => {
+ if (self.opener)
+ self.opener.postMessage(evt.data, '*');
+ else
+ self.top.postMessage(evt.data, '*');
+ }, { once: true });
+
+ const params = new URLSearchParams(self.location.search);
+ const frame = document.createElement('iframe');
+ frame.src = params.get('target');
+ document.body.appendChild(frame);
+
+ frame.addEventListener('load', function(){
+ frame.contentWindow.postMessage({op: 'request',
+ name: 'testLock', ifAvailable: true}, '*');
+ });
+}
+self.addEventListener('load', onLoad);
+</script>