mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
Update web-platform-tests to revision b'c9946198c9ee19db3b4974a388fae45da844a94a'
This commit is contained in:
parent
8dfd613aa1
commit
06e9d5a631
366 changed files with 8783 additions and 2336 deletions
|
@ -0,0 +1,11 @@
|
|||
// This is a regression test for Chromium issue https://crbug.com/1427266.
|
||||
test(() => {
|
||||
const iframe = document.createElement('iframe');
|
||||
document.body.append(iframe);
|
||||
const otherRequest = iframe.contentWindow.Request;
|
||||
iframe.remove();
|
||||
const r1 = new otherRequest('resource', { method: 'POST', body: 'string' });
|
||||
const r2 = new otherRequest(r1);
|
||||
assert_true(r1.bodyUsed);
|
||||
assert_false(r2.bodyUsed);
|
||||
}, 'creating a request from another request in a detached realm should work');
|
|
@ -79,3 +79,18 @@ promise_test(async function () {
|
|||
}
|
||||
)
|
||||
}, "Check static json() propagates JSON serializer errors");
|
||||
|
||||
const encodingChecks = [
|
||||
["𝌆", [34, 240, 157, 140, 134, 34]],
|
||||
["\uDF06\uD834", [34, 92, 117, 100, 102, 48, 54, 92, 117, 100, 56, 51, 52, 34]],
|
||||
["\uDEAD", [34, 92, 117, 100, 101, 97, 100, 34]],
|
||||
];
|
||||
|
||||
for (const [input, expected] of encodingChecks) {
|
||||
promise_test(async function () {
|
||||
const response = Response.json(input);
|
||||
const buffer = await response.arrayBuffer();
|
||||
const data = new Uint8Array(buffer);
|
||||
assert_array_equals(data, expected);
|
||||
}, `Check response returned by static json() with input ${input}`);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue