summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/loading/preloader-template.tentative.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/loading/preloader-template.tentative.html
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/loading/preloader-template.tentative.html')
-rw-r--r--testing/web-platform/tests/loading/preloader-template.tentative.html35
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/web-platform/tests/loading/preloader-template.tentative.html b/testing/web-platform/tests/loading/preloader-template.tentative.html
new file mode 100644
index 0000000000..e816309184
--- /dev/null
+++ b/testing/web-platform/tests/loading/preloader-template.tentative.html
@@ -0,0 +1,35 @@
+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<template>
+ <script src="resources/dummy.js?in-template"></script>
+ <link rel=stylesheet href="resources/dummy.css?in-template-1">
+ <style>
+ @import url("resources/dummy.css?in-template-2");
+ </style>
+</template>
+<script>
+ let t = async_test("Things inside templates are not preloaded");
+ window.addEventListener("load", t.step_func(function() {
+ let script = document.createElement("script");
+ script.onload = t.step_func_done(function() {
+ let entries = performance.getEntriesByType('resource');
+ let found_outside_template = false;
+ let found_in_template = [];
+ for (let entry of entries) {
+ if (entry.name.includes("outside-template")) {
+ found_outside_template = true;
+ }
+ if (entry.name.includes("in-template")) {
+ found_in_template.push(entry.name);
+ }
+ }
+ assert_equals(found_in_template.length, 0, "Should not have preloaded stuff inside template element, got: " + found_in_template.join(", "));
+ assert_true(found_outside_template, "Should have loaded script outside template element");
+ });
+ // The test is a bit racy because it expects that the first load ends
+ // before this one. We try to make it the case via the tickle mechanism.
+ script.src = "resources/dummy.js?outside-template&pipe=trickle(d1)";
+ document.body.appendChild(script);
+ }));
+</script>