mirror of
https://github.com/servo/servo.git
synced 2025-08-14 09:55:35 +01:00
Update web-platform-tests to revision d3cf77a7b8c20c678b725238eaa8a72eca3787ae
This commit is contained in:
parent
880f3b8b7a
commit
efca990ffe
541 changed files with 8000 additions and 2276 deletions
|
@ -22,6 +22,17 @@ function getSubresourceOrigin(originType) {
|
|||
const wsPort = getNormalizedPort(parseInt("{{ports[ws][0]}}", 10));
|
||||
const wssPort = getNormalizedPort(parseInt("{{ports[wss][0]}}", 10));
|
||||
|
||||
/**
|
||||
@typedef OriginType
|
||||
@type {string}
|
||||
|
||||
Represents the origin of the subresource request URL.
|
||||
The keys of `originMap` below are the valid values.
|
||||
|
||||
Note that there can be redirects from the specified origin
|
||||
(see RedirectionType), and thus the origin of the subresource
|
||||
response URL might be different from what is specified by OriginType.
|
||||
*/
|
||||
const originMap = {
|
||||
"same-https": httpsProtocol + "://" + sameOriginHost + httpsPort,
|
||||
"same-http": httpProtocol + "://" + sameOriginHost + httpPort,
|
||||
|
@ -63,7 +74,6 @@ function MixedContentTestCase(scenario, description, sanityChecker) {
|
|||
const urls = getRequestURLs(scenario.subresource,
|
||||
originTypeConversion[scenario.origin],
|
||||
scenario.redirection);
|
||||
const invoker = subresourceMap[scenario.subresource].invoker;
|
||||
const checkResult = _ => {
|
||||
// Send request to check if the key has been torn down.
|
||||
return xhrRequest(urls.assertUrl)
|
||||
|
@ -76,11 +86,18 @@ function MixedContentTestCase(scenario, description, sanityChecker) {
|
|||
};
|
||||
|
||||
function runTest() {
|
||||
/** @type {Subresource} */
|
||||
const subresource = {
|
||||
subresourceType: scenario.subresource,
|
||||
url: urls.testUrl,
|
||||
policyDeliveries: []
|
||||
};
|
||||
|
||||
promise_test(() => {
|
||||
return xhrRequest(urls.announceUrl)
|
||||
// Send out the real resource request.
|
||||
// This should tear down the key if it's not blocked.
|
||||
.then(_ => invoker(urls.testUrl))
|
||||
.then(_ => invokeRequest(subresource, []))
|
||||
// We check the key state, regardless of whether the main request
|
||||
// succeeded or failed.
|
||||
.then(checkResult, checkResult);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue