fune/testing/web-platform/tests/web-bundle/subresource-loading/path-restriction.https.tentative.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

52 lines
1.7 KiB
HTML

<!DOCTYPE html>
<title>Path restriction on subresource loading with WebBundles</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/path-restriction.wbn",
"resources": [
"/web-bundle/resources/wbn/resource.js",
"/web-bundle/resources/wbn/sub/resource.js",
"/web-bundle/resources/wbn-resource.js",
"/web-bundle/resources/wbn1/resource.js",
"/web-bundle/resources/other/resource.js",
"/web-bundle/resources/resource.js"
]
}
</script>
<script>
setup(() => {
assert_true(HTMLScriptElement.supports("webbundle"));
});
promise_test(async () => {
const resources = [
"/web-bundle/resources/wbn/resource.js",
"/web-bundle/resources/wbn/sub/resource.js",
];
for (const resource of resources) {
const response = await fetch(resource);
assert_true(response.ok, resource + " should be loaded");
}
}, "Subresources should be loaded.");
promise_test(async () => {
const resources = [
"/web-bundle/resources/wbn-resource.js",
"/web-bundle/resources/wbn1/resource.js",
"/web-bundle/resources/other/resource.js",
"/web-bundle/resources/resource.js",
];
for (const resource of resources) {
const response = await fetch(resource);
assert_false(response.ok, resource + " should not be loaded");
}
}, "Subresources should not be loaded due to path restriction.");
</script>
</body>