-
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 1690610 [wpt PR 27463] - Fetch: redirects to data: URLs, a=testonly
Automatic update from web-platform-tests Fetch: redirects to data: URLs For whatwg/fetch#393. -- wpt-commits: 0cae3be3b2ba254b0cf40858b8cea6c7156090d7 wpt-pr: 27463
- Loading branch information
1 parent
0958644
commit 200b6ce
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
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,25 @@ | ||
// See ../api/redirect/redirect-to-dataurl.any.js for fetch() tests | ||
|
||
async_test(t => { | ||
const img = document.createElement("img"); | ||
img.onload = t.unreached_func(); | ||
img.onerror = t.step_func_done(); | ||
img.src = "../api/resources/redirect.py?location=data:image/png%3Bbase64,iVBORw0KGgoAAAANSUhEUgAAAIUAAABqCAIAAAAdqgU8AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAF6SURBVHhe7dNBDQAADIPA%2Bje92eBxSQUQSLedlQzo0TLQonFWPVoGWjT%2BoUfLQIvGP/RoGWjR%2BIceLQMtGv/Qo2WgReMferQMtGj8Q4%2BWgRaNf%2BjRMtCi8Q89WgZaNP6hR8tAi8Y/9GgZaNH4hx4tAy0a/9CjZaBF4x96tAy0aPxDj5aBFo1/6NEy0KLxDz1aBlo0/qFHy0CLxj/0aBlo0fiHHi0DLRr/0KNloEXjH3q0DLRo/EOPloEWjX/o0TLQovEPPVoGWjT%2BoUfLQIvGP/RoGWjR%2BIceLQMtGv/Qo2WgReMferQMtGj8Q4%2BWgRaNf%2BjRMtCi8Q89WgZaNP6hR8tAi8Y/9GgZaNH4hx4tAy0a/9CjZaBF4x96tAy0aPxDj5aBFo1/6NEy0KLxDz1aBlo0/qFHy0CLxj/0aBlo0fiHHi0DLRr/0KNloEXjH3q0DLRo/EOPloEWjX/o0TLQovEPPVoGWjT%2BoUfLQIvGP/RoGWjR%2BIceJQMPIOzeGc0PIDEAAAAASUVORK5CYII"; | ||
}, "<img> fetch that redirects to data: URL"); | ||
|
||
globalThis.globalTest = null; | ||
async_test(t => { | ||
globalThis.globalTest = t; | ||
const script = document.createElement("script"); | ||
script.src = "../api/resources/redirect.py?location=data:text/javascript,(globalThis.globalTest.unreached_func())()"; | ||
script.onerror = t.step_func_done(); | ||
document.body.append(script); | ||
}, "<script> fetch that redirects to data: URL"); | ||
|
||
async_test(t => { | ||
const client = new XMLHttpRequest(); | ||
client.open("GET", "../api/resources/redirect.py?location=data:,"); | ||
client.send(); | ||
client.onload = t.unreached_func(); | ||
client.onerror = t.step_func_done(); | ||
}, "XMLHttpRequest fetch that redirects to data: URL"); |