-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: WPT runner * fix: add runner to ci
- Loading branch information
Showing
7 changed files
with
5,198 additions
and
2 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
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,40 @@ | ||
[ | ||
() => new Request("about:blank", { headers: { "Content-Type": "text/plain" } }), | ||
() => new Response("", { headers: { "Content-Type": "text/plain" } }) | ||
].forEach(bodyContainerCreator => { | ||
const bodyContainer = bodyContainerCreator(); | ||
promise_test(async t => { | ||
assert_equals(bodyContainer.headers.get("Content-Type"), "text/plain"); | ||
const newMIMEType = "test/test"; | ||
bodyContainer.headers.set("Content-Type", newMIMEType); | ||
const blob = await bodyContainer.blob(); | ||
assert_equals(blob.type, newMIMEType); | ||
}, `${bodyContainer.constructor.name}: overriding explicit Content-Type`); | ||
}); | ||
|
||
[ | ||
() => new Request("about:blank", { body: new URLSearchParams(), method: "POST" }), | ||
() => new Response(new URLSearchParams()), | ||
].forEach(bodyContainerCreator => { | ||
const bodyContainer = bodyContainerCreator(); | ||
promise_test(async t => { | ||
assert_equals(bodyContainer.headers.get("Content-Type"), "application/x-www-form-urlencoded;charset=UTF-8"); | ||
bodyContainer.headers.delete("Content-Type"); | ||
const blob = await bodyContainer.blob(); | ||
assert_equals(blob.type, ""); | ||
}, `${bodyContainer.constructor.name}: removing implicit Content-Type`); | ||
}); | ||
|
||
[ | ||
() => new Request("about:blank", { body: new ArrayBuffer(), method: "POST" }), | ||
() => new Response(new ArrayBuffer()), | ||
].forEach(bodyContainerCreator => { | ||
const bodyContainer = bodyContainerCreator(); | ||
promise_test(async t => { | ||
assert_equals(bodyContainer.headers.get("Content-Type"), null); | ||
const newMIMEType = "test/test"; | ||
bodyContainer.headers.set("Content-Type", newMIMEType); | ||
const blob = await bodyContainer.blob(); | ||
assert_equals(blob.type, newMIMEType); | ||
}, `${bodyContainer.constructor.name}: setting missing Content-Type`); | ||
}); |
Oops, something went wrong.