From 1b9c6c866db7d48332ab6804d75f8f3f8ff3300d Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Tue, 14 Sep 2021 09:58:56 +0000 Subject: [PATCH] Bug 1728844 [wpt PR 30309] - URLPattern: Support pattern syntax in IPv6 hostnames., a=testonly Automatic update from web-platform-tests URLPattern: Support pattern syntax in IPv6 hostnames. This adds support for patterns that having matching syntax inside of IPv6 address hostnames like: new URLPattern({ hostname: '[:address]' }); This issue is discussed here: https://github.com/WICG/urlpattern/issues/115 This CL also does a drive-by fix of a stale header reference in the blink presubmit warnings. Fixed: 1245998 Change-Id: I772258dc69c2b658ee4d7306b4f1975324624338 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3140140 Reviewed-by: Jeremy Roman Reviewed-by: Stephen McGruer Commit-Queue: Ben Kelly Cr-Commit-Position: refs/heads/main@{#919392} -- wpt-commits: 9ed05ce5db764a0c508090034ffbb7014ec2b639 wpt-pr: 30309 --- .../resources/urlpatterntestdata.json | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/testing/web-platform/tests/urlpattern/resources/urlpatterntestdata.json b/testing/web-platform/tests/urlpattern/resources/urlpatterntestdata.json index 5ef045e560acb..6138b30cdf5e4 100644 --- a/testing/web-platform/tests/urlpattern/resources/urlpatterntestdata.json +++ b/testing/web-platform/tests/urlpattern/resources/urlpatterntestdata.json @@ -2199,6 +2199,85 @@ "pathname": { "input": "/", "groups": {} } } }, + { + "pattern": [ "http://[:address]/" ], + "inputs": [ "http://[::1]/" ], + "exactly_empty_components": [ "username", "password", "port", "search", + "hash" ], + "expected_obj": { + "protocol": "http", + "hostname": "[:address]", + "pathname": "/" + }, + "expected_match": { + "protocol": { "input": "http", "groups": {} }, + "hostname": { "input": "[::1]", "groups": { "address": "::1" }}, + "pathname": { "input": "/", "groups": {} } + } + }, + { + "pattern": [ "http://[\\:\\:AB\\::num]/" ], + "inputs": [ "http://[::ab:1]/" ], + "exactly_empty_components": [ "username", "password", "port", "search", + "hash" ], + "expected_obj": { + "protocol": "http", + "hostname": "[\\:\\:ab\\::num]", + "pathname": "/" + }, + "expected_match": { + "protocol": { "input": "http", "groups": {} }, + "hostname": { "input": "[::ab:1]", "groups": { "num": "1" }}, + "pathname": { "input": "/", "groups": {} } + } + }, + { + "pattern": [{ "hostname": "[\\:\\:AB\\::num]" }], + "inputs": [{ "hostname": "[::ab:1]" }], + "expected_obj": { + "hostname": "[\\:\\:ab\\::num]" + }, + "expected_match": { + "hostname": { "input": "[::ab:1]", "groups": { "num": "1" }} + } + }, + { + "pattern": [{ "hostname": "[\\:\\:xY\\::num]" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "{[\\:\\:ab\\::num]}" }], + "inputs": [{ "hostname": "[::ab:1]" }], + "expected_match": { + "hostname": { "input": "[::ab:1]", "groups": { "num": "1" }} + } + }, + { + "pattern": [{ "hostname": "{[\\:\\:fé\\::num]}" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "{[\\:\\::num\\:1]}" }], + "inputs": [{ "hostname": "[::ab:1]" }], + "expected_match": { + "hostname": { "input": "[::ab:1]", "groups": { "num": "ab" }} + } + }, + { + "pattern": [{ "hostname": "{[\\:\\::num\\:fé]}" }], + "expected_obj": "error" + }, + { + "pattern": [{ "hostname": "[*\\:1]" }], + "inputs": [{ "hostname": "[::ab:1]" }], + "expected_match": { + "hostname": { "input": "[::ab:1]", "groups": { "0": "::ab" }} + } + }, + { + "pattern": [{ "hostname": "*\\:1]" }], + "expected_obj": "error" + }, { "pattern": [ "https://foo{{@}}example.com" ], "inputs": [ "https://foo@example.com" ],