summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webcodecs/encodedVideoChunk-serialization.crossAgentCluster.helper.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/webcodecs/encodedVideoChunk-serialization.crossAgentCluster.helper.html')
-rw-r--r--testing/web-platform/tests/webcodecs/encodedVideoChunk-serialization.crossAgentCluster.helper.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webcodecs/encodedVideoChunk-serialization.crossAgentCluster.helper.html b/testing/web-platform/tests/webcodecs/encodedVideoChunk-serialization.crossAgentCluster.helper.html
new file mode 100644
index 0000000000..424ce927f9
--- /dev/null
+++ b/testing/web-platform/tests/webcodecs/encodedVideoChunk-serialization.crossAgentCluster.helper.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p id='location'></p>
+<div id='log'></div>
+<script>
+ document.querySelector('#location').innerHTML = window.origin;
+ let received = new Map();
+ window.onmessage = (e) => {
+ let msg = e.data + ' (from ' + e.origin + ')';
+ document.querySelector('#log').innerHTML += '<p>' + msg + '<p>';
+ if (e.data.hasOwnProperty('id')) {
+ e.source.postMessage(
+ received.get(e.data.id) ? 'RECEIVED' : 'NOT_RECEIVED', '*');
+ return;
+ }
+ if (e.data.toString() == '[object EncodedVideoChunk]') {
+ received.set(e.data.timestamp, e.data);
+ }
+ };
+</script>
+</body>
+</html>