From 7dd24fefc180ae64e579470753fadd16b93c26ba Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Fri, 21 Jul 2023 19:19:19 +0000 Subject: [PATCH] Bug 1842883 [wpt PR 40968] - Revert "[Local Network Access] Rename private to local in request.cc", a=testonly Automatic update from web-platform-tests Revert "[Local Network Access] Rename private to local in request.cc" This reverts commit 3037cbc62a25a6a929e6c8cbc3ea41b23df18960. Reason for revert: The spec has been renamed back to Private Network Access https://github.com/WICG/private-network-access/pull/106 Original change's description: > [Local Network Access] Rename private to local in request.cc > > In https://github.com/WICG/local-network-access/issues/91, we decided to > rename (public, private, local) IP address spaces to (public, local, > loopback). The spec has already been renamed in > https://github.com/WICG/local-network-access/pull/97. > New spec: > https://wicg.github.io/local-network-access/#ip-address-space-heading > > This CL renames the string representation in request.cc. It also updates > a mixed content wpt because it uses targetAddressSpace defined in > Request. > > There are so many places to rename, so during the process, there will > inevitably be inconsistencies. Hopefully, we shall resolve all of them > soon. > > Bug: 1418287 > Change-Id: Ib01eb5385626c410d2b5f2bba4a67b86a28380d6 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4317043 > Reviewed-by: Camille Lamy > Commit-Queue: Jonathan Hao > Cr-Commit-Position: refs/heads/main{#1115707} Bug: 1418287 Change-Id: I7c7f1abb26e31c9b5a9531000aa572d16ef0f3ac Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4670564 Reviewed-by: Arthur Hemery Commit-Queue: Arthur Hemery Auto-Submit: Jonathan Hao Quick-Run: Jonathan Hao Cr-Commit-Position: refs/heads/main{#1168815} -- wpt-commits: 0b9e87dcaa97a472760b165f20679338ddcbf30b wpt-pr: 40968 UltraBlame original commit: 3363e3ba006e3d6813284cdf2adfcade6c21df88 --- ...ed-content-fetch.tentative.https.window.js | 66 +++++++++---------- .../resources/support.sub.js | 28 ++++---- 2 files changed, 46 insertions(+), 48 deletions(-) diff --git a/testing/web-platform/tests/fetch/local-network-access/mixed-content-fetch.tentative.https.window.js b/testing/web-platform/tests/fetch/local-network-access/mixed-content-fetch.tentative.https.window.js index 868315ff3914b..38a7a48464059 100644 --- a/testing/web-platform/tests/fetch/local-network-access/mixed-content-fetch.tentative.https.window.js +++ b/testing/web-platform/tests/fetch/local-network-access/mixed-content-fetch.tentative.https.window.js @@ -16,9 +16,9 @@ setup(() => { function otherAddressSpaces(addressSpace) { switch (addressSpace) { - case "loopback": return ["unknown", "local", "public"]; - case "local": return ["unknown", "loopback", "public"]; - case "public": return ["unknown", "loopback", "local"]; + case "local": return ["unknown", "private", "public"]; + case "private": return ["unknown", "local", "public"]; + case "public": return ["unknown", "local", "private"]; } } @@ -169,7 +169,7 @@ function makeNoBypassTests({ source, target }) { }, fetchOptions: { targetAddressSpace: correctAddressSpace }, expected: FetchTestResult.FAILURE, - }), prefix + 'not a local network request.'); + }), prefix + 'not a private network request.'); } @@ -178,9 +178,9 @@ function makeNoBypassTests({ source, target }) { -makeNoBypassTests({ source: "loopback", target: "loopback" }); -makeNoBypassTests({ source: "loopback", target: "local" }); -makeNoBypassTests({ source: "loopback", target: "public" }); +makeNoBypassTests({ source: "local", target: "local" }); +makeNoBypassTests({ source: "local", target: "private" }); +makeNoBypassTests({ source: "local", target: "public" }); @@ -192,10 +192,10 @@ makeNoBypassTests({ source: "loopback", target: "public" }); -makeTests({ source: "local", target: "loopback" }); +makeTests({ source: "private", target: "local" }); -makeNoBypassTests({ source: "local", target: "local" }); -makeNoBypassTests({ source: "local", target: "public" }); +makeNoBypassTests({ source: "private", target: "private" }); +makeNoBypassTests({ source: "private", target: "public" }); @@ -203,8 +203,8 @@ makeNoBypassTests({ source: "local", target: "public" }); -makeTests({ source: "public", target: "loopback" }); makeTests({ source: "public", target: "local" }); +makeTests({ source: "public", target: "private" }); makeNoBypassTests({ source: "public", target: "public" }); @@ -212,23 +212,21 @@ makeNoBypassTests({ source: "public", target: "public" }); -promise_test_parallel( - t => fetchTest(t, { - source: { - server: Server.HTTPS_LOCAL, - treatAsPublic: true, - }, - target: { - server: Server.HTTP_LOCAL, - behavior: { - preflight: PreflightBehavior.optionalSuccess(token()), - response: ResponseBehavior.allowCrossOrigin(), - }, - }, - fetchOptions: {targetAddressSpace: 'local'}, - expected: FetchTestResult.FAILURE, - }), - 'https-treat-as-public to http-loopback: wrong targetAddressSpace "local".'); +promise_test_parallel(t => fetchTest(t, { + source: { + server: Server.HTTPS_LOCAL, + treatAsPublic: true, + }, + target: { + server: Server.HTTP_LOCAL, + behavior: { + preflight: PreflightBehavior.optionalSuccess(token()), + response: ResponseBehavior.allowCrossOrigin(), + }, + }, + fetchOptions: { targetAddressSpace: "private" }, + expected: FetchTestResult.FAILURE, +}), 'https-treat-as-public to http-local: wrong targetAddressSpace "private".'); promise_test_parallel(t => fetchTest(t, { source: { @@ -242,9 +240,9 @@ promise_test_parallel(t => fetchTest(t, { response: ResponseBehavior.allowCrossOrigin(), }, }, - fetchOptions: { targetAddressSpace: "loopback" }, + fetchOptions: { targetAddressSpace: "local" }, expected: FetchTestResult.SUCCESS, -}), "https-treat-as-public to http-loopback: success."); +}), "https-treat-as-public to http-local: success."); promise_test_parallel(t => fetchTest(t, { source: { @@ -258,9 +256,9 @@ promise_test_parallel(t => fetchTest(t, { response: ResponseBehavior.allowCrossOrigin(), }, }, - fetchOptions: { targetAddressSpace: "loopback" }, + fetchOptions: { targetAddressSpace: "local" }, expected: FetchTestResult.FAILURE, -}), 'https-treat-as-public to http-local: wrong targetAddressSpace "loopback".'); +}), 'https-treat-as-public to http-private: wrong targetAddressSpace "local".'); promise_test_parallel(t => fetchTest(t, { source: { @@ -274,6 +272,6 @@ promise_test_parallel(t => fetchTest(t, { response: ResponseBehavior.allowCrossOrigin(), }, }, - fetchOptions: { targetAddressSpace: "local" }, + fetchOptions: { targetAddressSpace: "private" }, expected: FetchTestResult.SUCCESS, -}), "https-treat-as-public to http-local: success."); +}), "https-treat-as-public to http-private: success."); diff --git a/testing/web-platform/tests/fetch/local-network-access/resources/support.sub.js b/testing/web-platform/tests/fetch/local-network-access/resources/support.sub.js index de3332ba0efb5..cdb3856486d67 100644 --- a/testing/web-platform/tests/fetch/local-network-access/resources/support.sub.js +++ b/testing/web-platform/tests/fetch/local-network-access/resources/support.sub.js @@ -75,21 +75,21 @@ async function postMessageAndAwaitReply(target, message) { const SERVER_PORTS = { "http": { - "loopback": {{ports[http][0]}}, - "local": {{ports[http-private][0]}}, + "local": {{ports[http][0]}}, + "private": {{ports[http-private][0]}}, "public": {{ports[http-public][0]}}, }, "https": { - "loopback": {{ports[https][0]}}, - "other-loopback": {{ports[https][1]}}, - "local": {{ports[https-private][0]}}, + "local": {{ports[https][0]}}, + "other-local": {{ports[https][1]}}, + "private": {{ports[https-private][0]}}, "public": {{ports[https-public][0]}}, }, "ws": { - "loopback": {{ports[ws][0]}}, + "local": {{ports[ws][0]}}, }, "wss": { - "loopback": {{ports[wss][0]}}, + "local": {{ports[wss][0]}}, }, }; @@ -127,15 +127,15 @@ class Server { }; } - static HTTP_LOCAL = Server.get("http", "loopback"); - static HTTP_PRIVATE = Server.get("http", "local"); + static HTTP_LOCAL = Server.get("http", "local"); + static HTTP_PRIVATE = Server.get("http", "private"); static HTTP_PUBLIC = Server.get("http", "public"); - static HTTPS_LOCAL = Server.get("https", "loopback"); - static OTHER_HTTPS_LOCAL = Server.get("https", "other-loopback"); - static HTTPS_PRIVATE = Server.get("https", "local"); + static HTTPS_LOCAL = Server.get("https", "local"); + static OTHER_HTTPS_LOCAL = Server.get("https", "other-local"); + static HTTPS_PRIVATE = Server.get("https", "private"); static HTTPS_PUBLIC = Server.get("https", "public"); - static WS_LOCAL = Server.get("ws", "loopback"); - static WSS_LOCAL = Server.get("wss", "loopback"); + static WS_LOCAL = Server.get("ws", "local"); + static WSS_LOCAL = Server.get("wss", "local"); };