Skip to content

Commit cff1ac1

Browse files
Add URLPattern WPTs for hosts containing '/?#'
This CL adds new URLPattern WPTs testing path, query, and fragment delimiters in a hostname. This should be allowed and considered the end of the hostname per the spec but is currently failing. This test also updates the expected.txt files to expect them to fail currently. Future changes to URLPattern dummy URL canonicalization will ensure these tests pass. See https://chromium-review.googlesource.com/c/chromium/src/+/6819984/comments/9f5d126b_edf13a24 Bug: 4093508 Change-Id: I6cc884d1b3cbb1ab50413d6ae05bf9472d5a7e7f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6821208 Reviewed-by: Takashi Nakayama <tnak@chromium.org> Commit-Queue: Dave Risney <david.risney@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1503692}
1 parent 6b05e1d commit cff1ac1

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

urlpattern/resources/urlpatterntestdata.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2991,5 +2991,47 @@
29912991
"pattern": [{ "pathname": "/([\\d&&[0-1]])" }],
29922992
"inputs": [{ "pathname": "/3" }],
29932993
"expected_match": null
2994+
},
2995+
{
2996+
"pattern": [{ "protocol": "http", "hostname": "example.com/ignoredpath" }],
2997+
"inputs": ["http://example.com/"],
2998+
"expected_obj": {
2999+
"protocol": "http",
3000+
"hostname": "example.com",
3001+
"pathname": "*"
3002+
},
3003+
"expected_match": {
3004+
"protocol": { "input": "http", "groups": {} },
3005+
"hostname": { "input": "example.com", "groups": {} },
3006+
"pathname": { "input": "/", "groups": { "0": "/" } }
3007+
}
3008+
},
3009+
{
3010+
"pattern": [{ "protocol": "http", "hostname": "example.com\\?ignoredsearch" }],
3011+
"inputs": ["http://example.com/"],
3012+
"expected_obj": {
3013+
"protocol": "http",
3014+
"hostname": "example.com",
3015+
"search": "*"
3016+
},
3017+
"expected_match": {
3018+
"protocol": { "input": "http", "groups": {} },
3019+
"hostname": { "input": "example.com", "groups": {} },
3020+
"pathname": { "input": "/", "groups": { "0": "/" } }
3021+
}
3022+
},
3023+
{
3024+
"pattern": [{ "protocol": "http", "hostname": "example.com#ignoredhash" }],
3025+
"inputs": ["http://example.com/"],
3026+
"expected_obj": {
3027+
"protocol": "http",
3028+
"hostname": "example.com",
3029+
"hash": "*"
3030+
},
3031+
"expected_match": {
3032+
"protocol": { "input": "http", "groups": {} },
3033+
"hostname": { "input": "example.com", "groups": {} },
3034+
"pathname": { "input": "/", "groups": { "0": "/" } }
3035+
}
29943036
}
29953037
]

0 commit comments

Comments
 (0)