-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1743782 [wpt PR 30970] - Create resource timing entries for fetch…
… network errors, a=testonly Automatic update from web-platform-tests Create resource timing entries for fetch network errors (#30970) * Create resource timing entries for fetch network errors An initial test for whatwg/fetch#1215 * Remove a few ambiguous errors * Remove timeout scenario * Remove unnecessary lines * Added mixed content case * Try to make test less flaky * Make test not flaky * Use attribute_test * lint -- wpt-commits: 029d8d6672ceaed11b0cfef841621ece520a78ec wpt-pr: 30970
- Loading branch information
1 parent
f1653b2
commit 41017ac
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
testing/web-platform/tests/resource-timing/entries-for-network-errors.sub.https.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,35 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>This test validates that a failed cross-origin fetch creates an opaque network timing entry. | ||
</title> | ||
<link rel="author" title="Noam Rosenthal" href="noam@webkit.org"> | ||
<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/common/get-host-info.sub.js"></script> | ||
<script src="resources/entry-invariants.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
const validDataURL = 'data:,Hello%2C%20World%21' | ||
const {REMOTE_ORIGIN, ORIGINAL_HOST, HTTP_PORT} = get_host_info(); | ||
const validXmlUrl = '/common/dummy.xml'; | ||
|
||
network_error_entry_test( | ||
`${REMOTE_ORIGIN}${validXmlUrl}`, null, `failed cross-origin requests`); | ||
|
||
network_error_entry_test(`/common/redirect.py?location=${validDataURL}`, null, "non-HTTP redirect"); | ||
network_error_entry_test('//{{hosts[][nonexistent]}}/common/dummy.xml', null, "DNS failure"); | ||
network_error_entry_test(`http://${ORIGINAL_HOST}:${HTTP_PORT}/commo/dummy.xml`, null, "Mixed content"); | ||
|
||
network_error_entry_test('/common/dummy.xml', {cache: 'only-if-cached'}, | ||
"only-if-cached resource that was not cached"); | ||
|
||
network_error_entry_test( | ||
`/element-timing/resources/multiple-redirects.py?redirect_count=22&final_resource=${validXmlUrl}`, | ||
null, "too many redirects"); | ||
</script> | ||
</body> | ||
</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