Skip to content

Commit 160a048

Browse files
metcoder95github-actions[bot]
authored andcommitted
chore: update WPT
1 parent 6211fac commit 160a048

32 files changed

+598
-744
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
features:
2+
- name: fetch-request-streams
3+
files:
4+
- request-upload*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
features:
2+
- name: zstd
3+
files: "**"

test/fixtures/wpt/fetch/http-cache/heuristic.any.js

+25-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,33 @@ var tests = [
3232
],
3333
},
3434
{
35-
expected_type: "not_cached"
35+
expected_type: "not_cached",
3636
}
3737
]
38-
}
38+
},
39+
{
40+
name: "HTTP cache does not reuse a redirected response with no max-age and no Last-Modified header",
41+
requests: [
42+
{
43+
response_status: [301, "Moved Permanently"],
44+
response_headers: [
45+
["Cache-Control", "private"],
46+
["Location", "redirect_target"]
47+
],
48+
},
49+
{ skip: true}, // Response to first redirect
50+
{
51+
response_status: [301, "Moved Permanently"],
52+
response_headers: [
53+
["Cache-Control", "private"],
54+
["Location", "redirect_target"]
55+
],
56+
expected_type: "not_cached",
57+
},
58+
{ skip: true}, // response to second redirect
59+
],
60+
check_count: true,
61+
},
3962
];
4063

4164
function check_status(status) {

test/fixtures/wpt/fetch/http-cache/http-cache.js

+17-6
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,25 @@ function makeTest (test) {
4343
var uuid = token()
4444
var requests = expandTemplates(test)
4545
var fetchFunctions = makeFetchFunctions(requests, uuid)
46-
return runTest(fetchFunctions, requests, uuid)
46+
return runTest(fetchFunctions, test, requests, uuid)
4747
}
4848
}
4949

5050
function makeFetchFunctions(requests, uuid) {
5151
var fetchFunctions = []
5252
for (let i = 0; i < requests.length; ++i) {
53+
var config = requests[i];
54+
if (config.skip) {
55+
// Skip request are ones that we expect the browser to make in
56+
// response to a redirect. We don't fetch them again, but
57+
// the server needs them in the config to be able to respond to
58+
// them.
59+
continue;
60+
}
5361
fetchFunctions.push({
5462
code: function (idx) {
5563
var config = requests[idx]
56-
var url = makeTestUrl(uuid, config)
64+
var url = makeTestUrl(uuid, config);
5765
var init = fetchInit(requests, config)
5866
return fetch(url, init)
5967
.then(makeCheckResponse(idx, config))
@@ -71,7 +79,7 @@ function makeFetchFunctions(requests, uuid) {
7179
return fetchFunctions
7280
}
7381

74-
function runTest(fetchFunctions, requests, uuid) {
82+
function runTest(fetchFunctions, test, requests, uuid) {
7583
var idx = 0
7684
function runNextStep () {
7785
if (fetchFunctions.length) {
@@ -93,7 +101,7 @@ function runTest(fetchFunctions, requests, uuid) {
93101
.then(function () {
94102
return getServerState(uuid)
95103
}).then(function (testState) {
96-
checkRequests(requests, testState)
104+
checkRequests(test, requests, testState)
97105
return Promise.resolve()
98106
})
99107
}
@@ -153,7 +161,7 @@ function makeCheckResponse (idx, config) {
153161
if ('expected_status' in config) {
154162
assert_equals(response.status, config.expected_status,
155163
`Response ${reqNum} status is ${response.status}, not ${config.expected_status}`)
156-
} else if ('response_status' in config) {
164+
} else if ('response_status' in config && config.response_status[0] != 301) {
157165
assert_equals(response.status, config.response_status[0],
158166
`Response ${reqNum} status is ${response.status}, not ${config.response_status[0]}`)
159167
} else {
@@ -197,7 +205,7 @@ function makeCheckResponseBody (config, uuid) {
197205
}
198206
}
199207

200-
function checkRequests (requests, testState) {
208+
function checkRequests (test, requests, testState) {
201209
var testIdx = 0
202210
for (let i = 0; i < requests.length; ++i) {
203211
var expectedValidatingHeaders = []
@@ -225,6 +233,9 @@ function checkRequests (requests, testState) {
225233
})
226234
}
227235
}
236+
if (test?.check_count && testState) {
237+
assert_equals(requests.length, testState.length);
238+
}
228239
}
229240

230241
function pause () {

test/fixtures/wpt/fetch/http-cache/split-cache.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
function check_server_info() {
129129
return getServerState(uuid)
130130
.then(function (testState) {
131-
checkRequests(local_requests, testState)
131+
checkRequests(undefined, local_requests, testState)
132132
return Promise.resolve()
133133
})
134134
}

test/fixtures/wpt/fetch/private-network-access/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ See also:
88
* [The specification](https://wicg.github.io/private-network-access/)
99
* [The repository](https://github.com/WICG/private-network-access/)
1010
* [Open issues](https://github.com/WICG/private-network-access/issues/)
11+
12+
Private Network Access is deprecated and will eventually be replaced by [Local
13+
Network Access](https://github.com/explainers-by-googlers/local-network-access).

test/fixtures/wpt/fetch/private-network-access/fenced-frame-no-preflight-required.tentative.https.window.js

-91
This file was deleted.

0 commit comments

Comments
 (0)