diff options
Diffstat (limited to 'testing/web-platform/mozilla/tests/service-workers/resources/crossorigin_media_iframe.html')
-rw-r--r-- | testing/web-platform/mozilla/tests/service-workers/resources/crossorigin_media_iframe.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/web-platform/mozilla/tests/service-workers/resources/crossorigin_media_iframe.html b/testing/web-platform/mozilla/tests/service-workers/resources/crossorigin_media_iframe.html new file mode 100644 index 0000000000..54cdcaa8dd --- /dev/null +++ b/testing/web-platform/mozilla/tests/service-workers/resources/crossorigin_media_iframe.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<body> +<script> + +'use strict'; + +function remoteize(relpath) { + let curdir = location.href.replace(/\/[^\/]*$/, '/') + return curdir.replace('://', '://www1.') + relpath +} + +function create_media_promise() { + return new Promise((resolve, reject) => { + let video = document.createElement('video') + video.autoplay = true + video.muted = true + video.onplay = () => resolve('ok') + video.onerror = () => reject('video error') + video.src = remoteize('fetch_video.py') + }) +} + +</script> +</body> |