mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
@ -0,0 +1,20 @@
|
|||
promise_test(() => fetch("resources/data-urls.json").then(res => res.json()).then(runDataURLTests), "Setup.");
|
||||
function runDataURLTests(tests) {
|
||||
for(let i = 0; i < tests.length; i++) {
|
||||
const input = tests[i][0],
|
||||
expectedMimeType = tests[i][1],
|
||||
expectedBody = expectedMimeType !== null ? tests[i][2] : null;
|
||||
promise_test(t => {
|
||||
if(expectedMimeType === null) {
|
||||
return promise_rejects(t, new TypeError(), fetch(input));
|
||||
} else {
|
||||
return fetch(input).then(res => {
|
||||
return res.arrayBuffer().then(body => {
|
||||
assert_array_equals(new Uint8Array(body), expectedBody);
|
||||
assert_equals(res.headers.get("content-type"), expectedMimeType); // We could assert this earlier, but this fails often
|
||||
});
|
||||
});
|
||||
}
|
||||
}, format_value(input));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue