diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /testing/web-platform/tests/preload | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/preload')
-rw-r--r-- | testing/web-platform/tests/preload/resources/A4.ogv | bin | 94372 -> 0 bytes | |||
-rw-r--r-- | testing/web-platform/tests/preload/supported-as-values.html | 44 |
2 files changed, 44 insertions, 0 deletions
diff --git a/testing/web-platform/tests/preload/resources/A4.ogv b/testing/web-platform/tests/preload/resources/A4.ogv Binary files differdeleted file mode 100644 index de99616ece..0000000000 --- a/testing/web-platform/tests/preload/resources/A4.ogv +++ /dev/null diff --git a/testing/web-platform/tests/preload/supported-as-values.html b/testing/web-platform/tests/preload/supported-as-values.html new file mode 100644 index 0000000000..34abf80410 --- /dev/null +++ b/testing/web-platform/tests/preload/supported-as-values.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> +<title>Test the supported value for <link rel=preload as="..."></title> +<meta name="timeout" content="long"> +<meta name="variant" content="?as=image&expected=1"> +<meta name="variant" content="?as=fetch&expected=1"> +<meta name="variant" content="?as=font&expected=1"> +<meta name="variant" content="?as=script&expected=1"> +<meta name="variant" content="?as=style&expected=1"> +<meta name="variant" content="?as=track&expected=1"> + +<meta name="variant" content="?as=garbagefoobar&expected=0"> +<meta name="variant" content="?as=video&expected=0"> +<meta name="variant" content="?as=audio&expected=0"> +<meta name="variant" content="?as=object&expected=0"> +<meta name="variant" content="?as=iframe&expected=0"> +<meta name="variant" content="?as=worklet&expected=0"> +<meta name="variant" content="?as=json&expected=0"> + +<script src="/common/utils.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<script> + const params = new URLSearchParams(location.search); + const as = params.get("as"); + const expected = Number(params.get("expected")); + promise_test(async t => { + const link = document.createElement("link"); + link.href = new URL("/common/echo.py?content=nothing", location.href).href; + link.rel = "preload"; + link.as = as; + document.head.append(link); + await new Promise(resolve => { + t.step_timeout(resolve, 1000); + link.addEventListener("load", resolve); + link.addEventListener("error", resolve); + }); + const resources = performance.getEntriesByName(link.href); + assert_equals(resources.length, expected); + }); +</script> +</body> +</html> |