Update web-platform-tests to revision 4adce83d1f2b08fa2e92427c4687d0cf535aee53

This commit is contained in:
WPT Sync Bot 2019-01-08 20:47:25 -05:00
parent d3763452b5
commit 3e4ec1724a
102 changed files with 3019 additions and 1309 deletions

View file

@ -45,7 +45,12 @@
const get_url = (mime) => {
// www1 is cross-origin, so the HTTP response is CORB-eligible -->
url = "http://{{domains[www1]}}:{{ports[http][0]}}"
//
// TODO(lukasza@chromium.org): Once https://crbug.com/888079 and
// https://crbug.com/891872 are fixed, we should use a cross-*origin*
// rather than cross-*site* URL below (e.g. s/hosts[alt]/domains/g).
// See also https://crbug.com/918660 for more context.
url = "http://{{hosts[alt][www1]}}:{{ports[http][0]}}"
url = url + "/fetch/nosniff/resources/image.py"
if (mime != null) {
url += "?type=" + encodeURIComponent(mime)

View file

@ -7,5 +7,11 @@
<meta charset="utf-8">
<!-- Reference page uses same-origin resources, which are not CORB-eligible. -->
<link rel="match" href="img-png-mislabeled-as-html-nosniff.tentative.sub-ref.html">
<!-- www1 is cross-origin, so the HTTP response is CORB-eligible -->
<img src="http://{{domains[www1]}}:{{ports[http][0]}}/fetch/corb/resources/png-mislabeled-as-html-nosniff.png">
<!-- www1 is cross-origin, so the HTTP response is CORB-eligible
TODO(lukasza@chromium.org): Once https://crbug.com/888079 and
https://crbug.com/891872 are fixed, we should use a cross-*origin*
rather than cross-*site* URL below (e.g. s/hosts[alt]/domains/g).
See also https://crbug.com/918660 for more context.
-->
<img src="http://{{hosts[alt][www1]}}:{{ports[http][0]}}/fetch/corb/resources/png-mislabeled-as-html-nosniff.png">

View file

@ -17,8 +17,14 @@ async_test(function(t) {
});
</script>
<!-- www1 is cross-origin, so the HTTP response is CORB-eligible -->
<!-- www1 is cross-origin, so the HTTP response is CORB-eligible
TODO(lukasza@chromium.org): Once https://crbug.com/888079 and
https://crbug.com/891872 are fixed, we should use a cross-*origin*
rather than cross-*site* URL below (e.g. s/hosts[alt]/domains/g).
See also https://crbug.com/918660 for more context.
-->
<link rel="preload" as="image"
onerror="window.preloadErrorEvent()"
onload="window.preloadLoadEvent()"
href="http://{{domains[www1]}}:{{ports[http][0]}}/fetch/corb/resources/png-mislabeled-as-html-nosniff.png">
href="http://{{hosts[alt][www1]}}:{{ports[http][0]}}/fetch/corb/resources/png-mislabeled-as-html-nosniff.png">

View file

@ -24,7 +24,12 @@ async_test(function(t) {
});
// www1 is cross-origin, so the HTTP response is CORB-eligible.
script.src = 'http://{{domains[www1]}}:{{ports[http][0]}}/fetch/corb/resources/html-correctly-labeled.html';
//
// TODO(lukasza@chromium.org): Once https://crbug.com/888079 and
// https://crbug.com/891872 are fixed, we should use a cross-*origin*
// rather than cross-*site* URL below (e.g. s/hosts[alt]/domains/g).
// See also https://crbug.com/918660 for more context.
script.src = 'http://{{hosts[alt][www1]}}:{{ports[http][0]}}/fetch/corb/resources/html-correctly-labeled.html';
document.body.appendChild(script)
}, "CORB-blocked script has no syntax errors");
</script>

View file

@ -68,7 +68,12 @@ function test(mime_type, body) {
});
// www1 is cross-origin, so the HTTP response is CORB-eligible.
var src_prefix = "http://{{domains[www1]}}:{{ports[http][0]}}/fetch/corb/resources/sniffable-resource.py";
//
// TODO(lukasza@chromium.org): Once https://crbug.com/888079 and
// https://crbug.com/891872 are fixed, we should use a cross-*origin*
// rather than cross-*site* URL below (e.g. s/hosts[alt]/domains/g).
// See also https://crbug.com/918660 for more context.
var src_prefix = "http://{{hosts[alt][www1]}}:{{ports[http][0]}}/fetch/corb/resources/sniffable-resource.py";
script.src = src_prefix + "?type=" + mime_type + "&body=" + encodeURIComponent(body);
document.body.appendChild(script)
}, "CORB-blocks '" + mime_type + "' that starts with the following JSON parser breaker: " + body);

View file

@ -0,0 +1,57 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTTP Cache - Caching POST and PATCH responses</title>
<meta name="help" href="https://fetch.spec.whatwg.org/#request">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="http-cache.js"></script>
</head>
<body>
<script>
var tests = [
{
name: "HTTP cache uses content after PATCH request with response containing Content-Location and cache-allowing header",
requests: [
{
request_method: "PATCH",
request_body: "abc",
response_status: [200, "OK"],
response_headers: [
['Cache-Control', "private, max-age=1000"],
['Content-Location', ""]
],
response_body: "abc"
},
{
expected_type: "cached"
}
]
},
{
name: "HTTP cache uses content after POST request with response containing Content-Location and cache-allowing header",
requests: [
{
request_method: "POST",
request_body: "abc",
response_status: [200, "OK"],
response_headers: [
['Cache-Control', "private, max-age=1000"],
['Content-Location', ""]
],
response_body: "abc"
},
{
expected_type: "cached"
}
]
}
];
run_tests(tests);
</script>
</body>
</html>

View file

@ -46,7 +46,10 @@ def handle_test(uuid, request, response):
now = time.time()
for header in config.get('response_headers', []):
if header[0].lower() in LOCATIONHDRS: # magic locations
header[1] = "%s&target=%s" % (request.url, header[1])
if (len(header[1]) > 0):
header[1] = "%s&target=%s" % (request.url, header[1])
else:
header[1] = request.url
if header[0].lower() in DATEHDRS and isinstance(header[1], int): # magic dates
header[1] = http_date(now, header[1])
response.headers.set(header[0], header[1])