Update web-platform-tests to revision 122a4672fa0dc554a6e7528fa3487fd907c792ee

This commit is contained in:
WPT Sync Bot 2019-03-23 21:54:52 -04:00
parent fb1123495f
commit 93d826f7ba
301 changed files with 4775 additions and 1769 deletions

View file

@ -1,3 +1,4 @@
// META: timeout=long
// META: global=window,worker
// META: script=/common/utils.js
// META: script=/common/get-host-info.sub.js

View file

@ -2,6 +2,7 @@
<html>
<head>
<title>Fetch: network timeout after receiving the HTTP response headers</title>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/utils.js"></script>

View file

@ -1,3 +1,4 @@
// META: timeout=long
// META: script=../resources/utils.js
// META: script=/common/get-host-info.sub.js

View file

@ -1,3 +1,4 @@
// META: timeout=long
// META: script=/common/utils.js
// META: script=../resources/utils.js
// META: script=/common/get-host-info.sub.js

View file

@ -0,0 +1,45 @@
// META: script=../resources/utils.js
// See https://github.com/whatwg/fetch/issues/883 for the behavior covered by
// this test. As of writing, the Fetch spec has not been updated to cover these.
// redirectLocation tests that a Location header of |locationHeader| is resolved
// to a URL which ends in |expectedUrlSuffix|. |locationHeader| is interpreted
// as a byte sequence via isomorphic encode, as described in [INFRA]. This
// allows the caller to specify byte sequences which are not valid UTF-8.
// However, this means, e.g., U+2603 must be passed in as "\xe2\x98\x83", its
// UTF-8 encoding, not "\u2603".
//
// [INFRA] https://infra.spec.whatwg.org/#isomorphic-encode
function redirectLocation(
desc, redirectUrl, locationHeader, expectedUrlSuffix) {
promise_test(function(test) {
// Note we use escape() instead of encodeURIComponent(), so that characters
// are escaped as bytes in the isomorphic encoding.
var url = redirectUrl + '?simple=1&location=' + escape(locationHeader);
return fetch(url, {'redirect': 'follow'}).then(function(resp) {
assert_true(
resp.url.endsWith(expectedUrlSuffix),
resp.url + ' ends with ' + expectedUrlSuffix);
});
}, desc);
}
var redirUrl = RESOURCES_DIR + 'redirect.py';
redirectLocation(
'Redirect to escaped UTF-8', redirUrl, 'top.txt?%E2%98%83%e2%98%83',
'top.txt?%E2%98%83%e2%98%83');
redirectLocation(
'Redirect to unescaped UTF-8', redirUrl, 'top.txt?\xe2\x98\x83',
'top.txt?%E2%98%83');
redirectLocation(
'Redirect to escaped and unescaped UTF-8', redirUrl,
'top.txt?\xe2\x98\x83%e2%98%83', 'top.txt?%E2%98%83%e2%98%83');
redirectLocation(
'Escaping produces double-percent', redirUrl, 'top.txt?%\xe2\x98\x83',
'top.txt?%%E2%98%83');
redirectLocation(
'Redirect to invalid UTF-8', redirUrl, 'top.txt?\xff', 'top.txt?%FF');
done();

View file

@ -1,3 +1,4 @@
// META: timeout=long
// META: script=/common/utils.js
// META: script=../resources/utils.js
// META: script=/common/get-host-info.sub.js

View file

@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<title>Request cache - default with conditional requests</title>
<meta name="timeout" content="long">
<meta name="help" href="https://fetch.spec.whatwg.org/#request">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

View file

@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<title>Request Keepalive Quota Tests</title>
<meta name="timeout" content="long">
<meta name="help" href="https://fetch.spec.whatwg.org/#request">
<meta name="help" href="https://fetch.spec.whatwg.org/#body-mixin">
<meta name="author" title="Microsoft Edge" href="https://www.microsoft.com">

View file

@ -38,16 +38,17 @@ def main(request, response):
if "location" in request.GET:
url = request.GET['location']
scheme = urlparse(url).scheme
if scheme == "" or scheme == "http" or scheme == "https":
url += "&" if '?' in url else "?"
#keep url parameters in location
url_parameters = {}
for item in request.GET.items():
url_parameters[item[0]] = item[1][0]
url += urlencode(url_parameters)
#make sure location changes during redirection loop
url += "&count=" + str(stashed_data['count'])
if "simple" not in request.GET:
scheme = urlparse(url).scheme
if scheme == "" or scheme == "http" or scheme == "https":
url += "&" if '?' in url else "?"
#keep url parameters in location
url_parameters = {}
for item in request.GET.items():
url_parameters[item[0]] = item[1][0]
url += urlencode(url_parameters)
#make sure location changes during redirection loop
url += "&count=" + str(stashed_data['count'])
headers.append(("Location", url))
if "redirect_referrerpolicy" in request.GET:

View file

@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<title>Response clone</title>
<meta name="timeout" content="long">
<meta name="help" href="https://fetch.spec.whatwg.org/#response">
<meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
<script src="/resources/testharness.js"></script>