mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05:33 +01:00
Update web-platform-tests to revision 10168e9a5d44efbc6e7d416d1d454eb9c9f1396c
This commit is contained in:
parent
c88dc51d03
commit
0e1caebaf4
791 changed files with 23381 additions and 5501 deletions
16
tests/wpt/web-platform-tests/fetch/data-urls/base64.any.js
Normal file
16
tests/wpt/web-platform-tests/fetch/data-urls/base64.any.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
promise_test(() => fetch("resources/base64.json").then(res => res.json()).then(runBase64Tests), "Setup.");
|
||||
function runBase64Tests(tests) {
|
||||
for(let i = 0; i < tests.length; i++) {
|
||||
const input = tests[i][0],
|
||||
output = tests[i][1],
|
||||
dataURL = "data:;base64," + input;
|
||||
promise_test(t => {
|
||||
if(output === null) {
|
||||
return promise_rejects(t, new TypeError(), fetch(dataURL));
|
||||
}
|
||||
return fetch(dataURL).then(res => res.arrayBuffer()).then(body => {
|
||||
assert_array_equals(new Uint8Array(body), output);
|
||||
});
|
||||
}, "data: URL base64 handling: " + format_value(input));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue