Skip to content

Commit bc73461

Browse files
Uzlopakgithub-actions[bot]
authored andcommitted
chore: update WPT
1 parent 0e64cd6 commit bc73461

22 files changed

Lines changed: 202 additions & 570 deletions

‎test/fixtures/wpt/fetch/content-encoding/br/bad-br-body.https.any.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
[
44
"arrayBuffer",
5+
"blob",
6+
"bytes",
7+
"formData",
8+
"json",
9+
"text"
510
].forEach(method => {
611
promise_test(t => {
712
return fetch("resources/bad-br-body.py").then(res => {

‎test/fixtures/wpt/fetch/content-encoding/gzip/bad-gzip-body.any.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ promise_test((test) => {
99
[
1010
"arrayBuffer",
1111
"blob",
12+
"bytes",
1213
"formData",
1314
"json",
1415
"text"

‎test/fixtures/wpt/fetch/content-encoding/zstd/bad-zstd-body.https.any.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ promise_test((test) => {
99
[
1010
"arrayBuffer",
1111
"blob",
12+
"bytes",
1213
"formData",
1314
"json",
1415
"text"

‎test/fixtures/wpt/fetch/local-network-access/fetch.tentative.https.html‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"use strict";
1212

1313
promise_test(t => {
14-
const sourceUrl = resolveUrl("resources/fetch-private.html",
14+
const sourceUrl = resolveUrl("resources/fetch-local.html",
1515
sourceResolveOptions({ server: Server.HTTPS_PUBLIC }));
1616

1717
function checkResult(evt) {
@@ -26,12 +26,12 @@
2626
t.add_cleanup(() => popup.close());
2727

2828
return promise;
29-
}, 'LNA Public to private with permission');
29+
}, 'LNA Public to local with permission');
3030

3131
promise_test(t => {
3232
// TODO(crbug.com/406991278): consider moving permission url param into
3333
// options
34-
const sourceUrl = resolveUrl("resources/fetch-private.html?permission=denied",
34+
const sourceUrl = resolveUrl("resources/fetch-local.html?permission=denied",
3535
sourceResolveOptions({ server: Server.HTTPS_PUBLIC }));
3636

3737
function checkResult(evt) {
@@ -46,10 +46,10 @@
4646
t.add_cleanup(() => popup.close());
4747

4848
return promise;
49-
}, 'LNA Public to private with permission denied');
49+
}, 'LNA Public to local with permission denied');
5050

5151
promise_test(t => {
52-
const sourceUrl = resolveUrl("resources/fetch-private-http.html",
52+
const sourceUrl = resolveUrl("resources/fetch-local-http.html",
5353
sourceResolveOptions({ server: Server.HTTPS_PUBLIC }));
5454

5555
function checkResult(evt) {
@@ -64,7 +64,7 @@
6464
t.add_cleanup(() => popup.close());
6565

6666
return promise;
67-
}, 'LNA Public to private http mixed content bypass');
67+
}, 'LNA Public to local http mixed content bypass');
6868

6969
promise_test(t => {
7070
const sourceUrl = resolveUrl("resources/fetch-public-http-wrong-address-space.html",

test/fixtures/wpt/fetch/local-network-access/resources/fetch-private-http.html renamed to test/fixtures/wpt/fetch/local-network-access/resources/fetch-local-http.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
3-
<title>Fetch HTTP private with targetAddressSpace private </title>
3+
<title>Fetch HTTP local with targetAddressSpace local </title>
44

55
<script src="/resources/testdriver.js"></script>
66
<script src="/resources/testdriver-vendor.js"></script>
77
<script src="support.sub.js"></script>
88
<script>
99
"use strict";
1010

11-
// Fetch a private address over HTTP. Fetch is annotated with a
12-
// targetAddressSpace of private to allow for mixed content check bypassing.
11+
// Fetch a local address over HTTP. Fetch is annotated with a
12+
// targetAddressSpace of local to allow for mixed content check bypassing.
1313
//
14-
// TODO(crbug.com/406991278): consolidate with fetch-private.html adding
14+
// TODO(crbug.com/406991278): consolidate with fetch-local.html adding
1515
// options to minimize # of resources needed.
1616
Promise.resolve().then(async () => {
1717
test_driver.set_test_context(opener);
1818
await test_driver.set_permission({ name: 'local-network-access' }, 'granted');
1919

2020
const target = {
21-
server: Server.HTTP_PRIVATE,
21+
server: Server.HTTP_LOCAL,
2222
behavior: { response: ResponseBehavior.allowCrossOrigin() },
2323
};
2424
const targetUrl = resolveTargetUrl(target);
2525

26-
// TODO(crbug.com/406991278): rename address space for LNA spec
27-
fetch(targetUrl, {targetAddressSpace: 'private'})
26+
fetch(targetUrl, {targetAddressSpace: 'local'})
2827
.then(async function(response) {
2928
const body = await response.text();
3029
const message = {

test/fixtures/wpt/fetch/local-network-access/resources/fetch-private.html renamed to test/fixtures/wpt/fetch/local-network-access/resources/fetch-local.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
3-
<title>Fetch Private resource</title>
3+
<title>Fetch Local resource</title>
44

55
<script src="/resources/testdriver.js"></script>
66
<script src="/resources/testdriver-vendor.js"></script>
@@ -9,7 +9,7 @@
99
"use strict";
1010

1111
// Set the 'local-network-access' permission then attempt to fetch a resource
12-
// in the private address space.
12+
// in the local address space.
1313
//
1414
// By default, 'local-network-access' permission is set to 'granted'. This can
1515
// be changed by passing in a different value via the 'permission' URL parameter.
@@ -30,7 +30,7 @@
3030
await test_driver.set_permission({ name: 'local-network-access' }, permission_value);
3131

3232
const target = {
33-
server: Server.HTTPS_PRIVATE,
33+
server: Server.HTTPS_LOCAL,
3434
behavior: { response: ResponseBehavior.allowCrossOrigin() },
3535
};
3636
const targetUrl = resolveTargetUrl(target);

‎test/fixtures/wpt/fetch/local-network-access/resources/fetch-public-http-wrong-address-space.html‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22
<meta charset="utf-8">
3-
<title>Fetch HTTP public targetAddress private resource</title>
3+
<title>Fetch HTTP public targetAddress local resource</title>
44

55
<script src="/resources/testdriver.js"></script>
66
<script src="/resources/testdriver-vendor.js"></script>
@@ -9,11 +9,11 @@
99
"use strict";
1010

1111
// Fetch a public address over HTTP. Fetch is annotated with a
12-
// targetAddressSpace of private to try to bypass mixed content, but should
12+
// targetAddressSpace of local to try to bypass mixed content, but should
1313
// fail because the address space of the resource does not match the target
1414
// address space.
1515
//
16-
// TODO(crbug.com/406991278): consolidate with fetch-private.html adding
16+
// TODO(crbug.com/406991278): consolidate with fetch-local.html adding
1717
// options to minimize # of resources needed.
1818
Promise.resolve().then(async () => {
1919
test_driver.set_test_context(opener);
@@ -25,8 +25,7 @@
2525
};
2626
const targetUrl = resolveTargetUrl(target);
2727

28-
// TODO(crbug.com/406991278): rename address space for LNA spec
29-
fetch(targetUrl, {targetAddressSpace: 'private'})
28+
fetch(targetUrl, {targetAddressSpace: 'local'})
3029
.then(async function(response) {
3130
const body = await response.text();
3231
const message = {

‎test/fixtures/wpt/fetch/local-network-access/resources/support.sub.js‎

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
// Maps protocol (without the trailing colon) and address space to port.
2+
//
3+
// TODO(crbug.com/418737577): change keys to be consistent with new address
4+
// space names.
25
const SERVER_PORTS = {
36
"http": {
4-
"local": {{ports[http][0]}},
5-
"private": {{ports[http-private][0]}},
7+
"loopback": {{ports[http][0]}},
8+
"local": {{ports[http-local][0]}},
69
"public": {{ports[http-public][0]}},
710
},
811
"https": {
9-
"local": {{ports[https][0]}},
10-
"other-local": {{ports[https][1]}},
11-
"private": {{ports[https-private][0]}},
12+
"loopback": {{ports[https][0]}},
13+
"other-loopback": {{ports[https][1]}},
14+
"local": {{ports[https-local][0]}},
1215
"public": {{ports[https-public][0]}},
1316
},
1417
"ws": {
15-
"local": {{ports[ws][0]}},
18+
"loopback": {{ports[ws][0]}},
1619
},
1720
"wss": {
18-
"local": {{ports[wss][0]}},
21+
"loopback": {{ports[wss][0]}},
1922
},
2023
};
2124

2225
// A `Server` is a web server accessible by tests. It has the following shape:
2326
//
2427
// {
25-
// addressSpace: the IP address space of the server ("local", "private" or
28+
// addressSpace: the IP address space of the server ("loopback", "local" or
2629
// "public"),
2730
// name: a human-readable name for the server,
2831
// port: the port on which the server listens for connections,
@@ -53,15 +56,15 @@ class Server {
5356
};
5457
}
5558

59+
static HTTP_LOOPBACK = Server.get("http", "loopback");
5660
static HTTP_LOCAL = Server.get("http", "local");
57-
static HTTP_PRIVATE = Server.get("http", "private");
5861
static HTTP_PUBLIC = Server.get("http", "public");
62+
static HTTPS_LOOPBACK = Server.get("https", "loopback");
63+
static OTHER_HTTPS_LOOPBACK = Server.get("https", "other-loopback");
5964
static HTTPS_LOCAL = Server.get("https", "local");
60-
static OTHER_HTTPS_LOCAL = Server.get("https", "other-local");
61-
static HTTPS_PRIVATE = Server.get("https", "private");
6265
static HTTPS_PUBLIC = Server.get("https", "public");
63-
static WS_LOCAL = Server.get("ws", "local");
64-
static WSS_LOCAL = Server.get("wss", "local");
66+
static WS_LOOPBACK = Server.get("ws", "loopback");
67+
static WSS_LOOPBACK = Server.get("wss", "loopback");
6568
};
6669

6770
// Resolves a URL relative to the current location, returning an absolute URL.

0 commit comments

Comments
 (0)