Skip to content

Commit

Permalink
Bug 1842883 [wpt PR 40968] - Revert "[Local Network Access] Rename pr…
Browse files Browse the repository at this point in the history
…ivate 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 WICG/private-network-access#106

Original change's description:
> [Local Network Access] Rename private to local in request.cc
>
> In WICG/private-network-access#91, we decided to
> rename (public, private, local) IP address spaces to (public, local,
> loopback). The spec has already been renamed in
> WICG/private-network-access#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 <clamychromium.org>
> Commit-Queue: Jonathan Hao <phaochromium.org>
> 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 <ahemerychromium.org>
Commit-Queue: Arthur Hemery <ahemerychromium.org>
Auto-Submit: Jonathan Hao <phaochromium.org>
Quick-Run: Jonathan Hao <phaochromium.org>
Cr-Commit-Position: refs/heads/main{#1168815}

--

wpt-commits: 0b9e87dcaa97a472760b165f20679338ddcbf30b
wpt-pr: 40968

UltraBlame original commit: 3363e3ba006e3d6813284cdf2adfcade6c21df88
  • Loading branch information
marco-c committed Jul 21, 2023
1 parent 1dc465d commit 7dd24fe
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
}
}

Expand Down Expand Up @@ -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.');
}


Expand All @@ -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" });



Expand All @@ -192,43 +192,41 @@ 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" });







makeTests({ source: "public", target: "loopback" });
makeTests({ source: "public", target: "local" });
makeTests({ source: "public", target: "private" });

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: {
Expand All @@ -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: {
Expand All @@ -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: {
Expand All @@ -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.");
Original file line number Diff line number Diff line change
Expand Up @@ -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]}},
},
};

Expand Down Expand Up @@ -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");
};


Expand Down

0 comments on commit 7dd24fe

Please sign in to comment.