Skip to content

Commit

Permalink
URLPattern: Add ignoresCase option.
Browse files Browse the repository at this point in the history
Implements spec changes from:

whatwg/urlpattern#168

Bug: 1345036
Change-Id: I659784cff5420603f8805aeed9bcd5852f97b5ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3866651
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1041730}
  • Loading branch information
wanderview authored and chromium-wpt-export-bot committed Aug 31, 2022
1 parent 249c453 commit 6644fd0
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions urlpattern/resources/urlpatterntestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2727,5 +2727,72 @@
"expected_match": {
"pathname": { "input": "/bazbar", "groups": { "foo": "baz" }}
}
},
{
"pattern": [{ "pathname": "/foo/bar" }, { "ignoreCase": true }],
"inputs": [{ "pathname": "/FOO/BAR" }],
"expected_match": {
"pathname": { "input": "/FOO/BAR", "groups": {} }
}
},
{
"pattern": [{ "ignoreCase": true }],
"inputs": [{ "pathname": "/FOO/BAR" }],
"expected_match": {
"pathname": { "input": "/FOO/BAR", "groups": { "0": "/FOO/BAR" } }
}
},
{
"pattern": [ "https://example.com:8080/foo?bar#baz",
{ "ignoreCase": true }],
"inputs": [{ "pathname": "/FOO", "search": "BAR", "hash": "BAZ",
"baseURL": "https://example.com:8080" }],
"exactly_empty_components": [ "username", "password" ],
"expected_obj": {
"protocol": "https",
"hostname": "example.com",
"port": "8080",
"pathname": "/foo",
"search": "bar",
"hash": "baz"
},
"expected_match": {
"protocol": { "input": "https", "groups": {} },
"hostname": { "input": "example.com", "groups": {} },
"port": { "input": "8080", "groups": {} },
"pathname": { "input": "/FOO", "groups": {} },
"search": { "input": "BAR", "groups": {} },
"hash": { "input": "BAZ", "groups": {} }
}
},
{
"pattern": [ "/foo?bar#baz", "https://example.com:8080",
{ "ignoreCase": true }],
"inputs": [{ "pathname": "/FOO", "search": "BAR", "hash": "BAZ",
"baseURL": "https://example.com:8080" }],
"exactly_empty_components": [ "username", "password" ],
"expected_obj": {
"protocol": "https",
"hostname": "example.com",
"port": "8080",
"pathname": "/foo",
"search": "bar",
"hash": "baz"
},
"expected_match": {
"protocol": { "input": "https", "groups": {} },
"hostname": { "input": "example.com", "groups": {} },
"port": { "input": "8080", "groups": {} },
"pathname": { "input": "/FOO", "groups": {} },
"search": { "input": "BAR", "groups": {} },
"hash": { "input": "BAZ", "groups": {} }
}
},
{
"pattern": [ "/foo?bar#baz", { "ignoreCase": true },
"https://example.com:8080" ],
"inputs": [{ "pathname": "/FOO", "search": "BAR", "hash": "BAZ",
"baseURL": "https://example.com:8080" }],
"expected_obj": "error"
}
]

0 comments on commit 6644fd0

Please sign in to comment.