-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This CL handles the error case when we fail to
fetch the Web Bundle due to network errors. Bug: 1168449 Change-Id: Ia3abb967e36274becc86e317bc51b1272d3ae679
- Loading branch information
1 parent
33c7cb5
commit ce28bb1
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
web-bundle/subresource-loading/subresource-loading-network-error.https.tentative.sub.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<title>Cross origin WebBundle subresource loading</title> | ||
<link rel="help" href="https://github.com/WICG/webpackage/blob/master/explainers/subresource-loading.md" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../resources/test-helpers.js"></script> | ||
|
||
<body> | ||
<!-- | ||
This test uses a non-existing WebBundle, | ||
https://www1.web-platform.test:8444/web-bundle/resources/wbn/cors/non-existing.wbn. | ||
The intent of this test is to check if failing to fetch a WebBundle also makes | ||
subresource fetch requests fail. | ||
--> | ||
<script> | ||
promise_test(async () => { | ||
const prefix = | ||
"https://{{hosts[][nonexistent]}}/"; | ||
const resources = [ | ||
prefix + "resource.js", | ||
]; | ||
const link = await addLinkAndWaitForError( | ||
prefix + "non-existing.wbn", | ||
resources, | ||
undefined | ||
); | ||
|
||
// Can not fetch a subresource because Web Bundle fetch failed. | ||
await fetchAndWaitForReject(prefix + "resource.js"); | ||
}, "Subresource fetch requests for non-existing Web Bundle should fail."); | ||
</script> | ||
</body> |
33 changes: 33 additions & 0 deletions
33
...ndle/subresource-loading/subresource-loading-web-bundle-fetch-failed.https.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<title>Cross origin WebBundle subresource loading</title> | ||
<link rel="help" href="https://github.com/WICG/webpackage/blob/master/explainers/subresource-loading.md" /> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../resources/test-helpers.js"></script> | ||
|
||
<body> | ||
<!-- | ||
This test uses a non-existing WebBundle, | ||
https://web-platform.test:8444/web-bundle/resources/wbn/cors/non-existing.wbn. | ||
The intent of this test is to check if failing to fetch a WebBundle also makes | ||
subresource fetch requests fail. | ||
--> | ||
<script> | ||
promise_test(async () => { | ||
const prefix = | ||
"https://web-platform.test:8444/web-bundle/resources/wbn/"; | ||
const resources = [ | ||
prefix + "resource.js", | ||
]; | ||
const link = await addLinkAndWaitForError( | ||
prefix + "non-existing.wbn", | ||
resources, | ||
undefined | ||
); | ||
|
||
// Can not fetch a subresource because Web Bundle fetch failed. | ||
await fetchAndWaitForReject(prefix + "resource.js"); | ||
}, "Subresource fetch requests for non-existing Web Bundle should fail."); | ||
</script> | ||
</body> |