diff --git a/web-bundle/resources/test-helpers.js b/web-bundle/resources/test-helpers.js index c1ff011e0d675a..94d5812cebd4c1 100644 --- a/web-bundle/resources/test-helpers.js +++ b/web-bundle/resources/test-helpers.js @@ -159,11 +159,15 @@ function createWebBundleElement(url, resources, options) { const script = document.createElement("script"); script.type = "webbundle"; const json_rule = {"source": url, "resources": resources}; - if (options && options.credentials) { - json_rule.credentials = options.credentials; + if (options) { + if (options.credentials) { + json_rule.credentials = options.credentials; + } + if (options.scopes) { + json_rule.scopes = options.scopes; + } } script.textContent = JSON.stringify(json_rule); - // TODO(crbug.com/1245166): Support |options.scopes|. return script; } diff --git a/web-bundle/subresource-loading/script-relative-url-resources.https.tentative.html b/web-bundle/subresource-loading/script-relative-url-resources.https.tentative.html new file mode 100644 index 00000000000000..9fd35c6f1179ae --- /dev/null +++ b/web-bundle/subresource-loading/script-relative-url-resources.https.tentative.html @@ -0,0 +1,81 @@ + +Subresource loading using relative URLs in the 'resources' + + + + + + + + + diff --git a/web-bundle/subresource-loading/script-relative-url-scopes.https.tentative.html b/web-bundle/subresource-loading/script-relative-url-scopes.https.tentative.html new file mode 100644 index 00000000000000..b3ecd8fee30d6d --- /dev/null +++ b/web-bundle/subresource-loading/script-relative-url-scopes.https.tentative.html @@ -0,0 +1,84 @@ + + + Subresource loading using relative URLs in the 'scopes' + + + + + + + + + + diff --git a/web-bundle/subresource-loading/script-relative-url.https.tentative.html b/web-bundle/subresource-loading/script-relative-url.https.tentative.html deleted file mode 100644 index 8b9a1cae9ef806..00000000000000 --- a/web-bundle/subresource-loading/script-relative-url.https.tentative.html +++ /dev/null @@ -1,24 +0,0 @@ - -Subresource loading using relative URLs in the 'resources' attribute - - - - - - - - - - - - \ No newline at end of file diff --git a/web-bundle/subresource-loading/script-reuse-web-bundle-resource.https.tentative.html b/web-bundle/subresource-loading/script-reuse-web-bundle-resource.https.tentative.html index 7429ae0a033145..55b7e9d85fae34 100644 --- a/web-bundle/subresource-loading/script-reuse-web-bundle-resource.https.tentative.html +++ b/web-bundle/subresource-loading/script-reuse-web-bundle-resource.https.tentative.html @@ -16,8 +16,11 @@ }); const wbn_url = "../resources/wbn/subresource.wbn"; - const resource1 = "../resources/wbn/root.js"; - const resource2 = "../resources/wbn/submodule.js"; + const resource1 = "root.js"; + const resource2 = "submodule.js"; + + const resource1_url = `../resources/wbn/${resource1}`; + const resource2_url = `../resources/wbn/${resource2}`; let script1; let script2; @@ -32,18 +35,18 @@ } async function assertResource1CanBeFetched() { - const response = await fetch(resource1); + const response = await fetch(resource1_url); const text = await response.text(); assert_equals(text, "export * from './submodule.js';\n"); } async function assertResource1CanNotBeFetched() { - const response = await fetch(resource1); + const response = await fetch(resource1_url); assert_equals(response.status, 404); } async function assertResource2CanBeFetched() { - const response = await fetch(resource2); + const response = await fetch(resource2_url); const text = await response.text(); assert_equals(text, "export const result = 'OK';\n"); }