fune/testing/web-platform/tests/web-bundle/subresource-loading/static-element.https.tentative.sub.html
DongJun Kim bd16ac337c Bug 1783523 [wpt PR 35369] - Rename external/wpt/web-bundle/subresource-loading/script-*.html tests, a=testonly
Automatic update from web-platform-tests
Rename external/wpt/web-bundle/subresource-loading/script-*.html tests

<link>-based APIs were removed, and "script-" prefix
doesn't make much sense anymore.

This patch remove "script-" prefix of WPT tests in web-bundle/subresource-loading.

Bug: 1347336
Change-Id: Iac4d719db0a637e7c59b78be5ed96e21aea8fafc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3812938
Reviewed-by: Hayato Ito <hayato@chromium.org>
Commit-Queue: DongJun Kim <deejay@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1035910}

--

wpt-commits: 4867f15871de2c6686cfcecbb79e35d39472b5df
wpt-pr: 35369
2022-09-04 17:59:01 +00:00

68 lines
2.6 KiB
HTML

<!DOCTYPE html>
<title>WebBundle subresource loading for static elements</title>
<link
rel="help"
href="https://github.com/WICG/webpackage/blob/main/explainers/subresource-loading.md"
/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script type="webbundle">
{
"source": "../resources/wbn/static-element.wbn",
"resources": [
"https://{{domains[]}}:{{ports[https][0]}}/web-bundle/resources/wbn/static-element/resources/script.js",
"https://{{domains[]}}:{{ports[https][0]}}/web-bundle/resources/wbn/static-element/resources/style.css",
"https://{{domains[]}}:{{ports[https][0]}}/web-bundle/resources/wbn/static-element/resources/style-imported-from-file.css",
"https://{{domains[]}}:{{ports[https][0]}}/web-bundle/resources/wbn/static-element/resources/style-imported-from-tag.css"
],
"scopes": [
"https://{{domains[]}}:{{ports[https][0]}}/web-bundle/resources/wbn/static-element/scopes/"
]
}
</script>
<style type="text/css">
@import "../resources/wbn/static-element/resources/style-imported-from-tag.css";
@import "../resources/wbn/static-element/scopes/style-imported-from-tag.css";
</style>
<link
href="../resources/wbn/static-element/resources/style.css"
rel="stylesheet"
/>
<link
href="../resources/wbn/static-element/scopes/style.css"
rel="stylesheet"
/>
<script src="../resources/wbn/static-element/resources/script.js"></script>
<script src="../resources/wbn/static-element/scopes/script.js"></script>
<script src="../resources/wbn/static-element/out-of-scope/script.js"></script>
<script>
setup(() => {
assert_true(HTMLScriptElement.supports("webbundle"));
});
promise_test(async () => {
assert_equals(resources_script_result, "loaded from webbundle");
assert_equals(scopes_script_result, "loaded from webbundle");
assert_equals(out_of_scope_script_result, "loaded from network");
["resources_", "scopes_"].forEach((type) => {
[
"style_target",
"style_imported_from_file_target",
"style_imported_from_tag_target",
].forEach((target) => {
const element = document.createElement("div");
element.id = type + target;
document.body.appendChild(element);
assert_equals(
window.getComputedStyle(element).color,
"rgb(0, 0, 255)",
element.id + " color must be blue"
);
});
});
}, "Subresources from static elements should be loaded from web bundle.");
</script>
</body>