diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/media-min-width.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/media-min-width.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/media-min-width.html | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/media-min-width.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/media-min-width.html new file mode 100644 index 0000000000..8a4ad500cb --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/media-min-width.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<video width="200"></video> +<script> +function createSource(src, media) { + var source = document.createElement('source'); + source.src = src; + if (media) { + source.media = media; + } + return source; +} +const rAF = () => new Promise(resolve => requestAnimationFrame(resolve)); +const hash = str => str.substr(str.lastIndexOf('#')); +(async () => { + const v = document.querySelector('video'); + v.getBoundingClientRect(); // force layout flush. ensure viewport dimensions are up-to-date + v.append(createSource('/media-source/mp4/test.mp4#a', '(min-width: 200px)')); + v.append(createSource('/media-source/mp4/test.mp4#b')); + await rAF(); + await rAF(); + window.resolveBeforeEnvChange(hash(v.currentSrc)); + window.frameElement.width = '150'; + await rAF(); + await rAF(); + window.resolveAfterEnvChange(hash(v.currentSrc)); + v.load() + await rAF(); + await rAF(); + window.resolveAfterLoadCalled(hash(v.currentSrc)); +})(); +</script> |