diff --git a/url/resources/setters_tests.json b/url/resources/setters_tests.json index d040d081c6d467..347caf49ab0520 100644 --- a/url/resources/setters_tests.json +++ b/url/resources/setters_tests.json @@ -1061,6 +1061,42 @@ "host": "", "hostname": "" } + }, + { + "href": "https://example.com/", + "new_value": "a%C2%ADb", + "expected": { + "href": "https://ab/", + "host": "ab", + "hostname": "ab" + } + }, + { + "href": "https://example.com/", + "new_value": "\u00AD", + "expected": { + "href": "https://example.com/", + "host": "example.com", + "hostname": "example.com" + } + }, + { + "href": "https://example.com/", + "new_value": "%C2%AD", + "expected": { + "href": "https://example.com/", + "host": "example.com", + "hostname": "example.com" + } + }, + { + "href": "https://example.com/", + "new_value": "xn--", + "expected": { + "href": "https://example.com/", + "host": "example.com", + "hostname": "example.com" + } } ], "hostname": [ @@ -1436,6 +1472,42 @@ "host": "", "hostname": "" } + }, + { + "href": "https://example.com/", + "new_value": "a%C2%ADb", + "expected": { + "href": "https://ab/", + "host": "ab", + "hostname": "ab" + } + }, + { + "href": "https://example.com/", + "new_value": "\u00AD", + "expected": { + "href": "https://example.com/", + "host": "example.com", + "hostname": "example.com" + } + }, + { + "href": "https://example.com/", + "new_value": "%C2%AD", + "expected": { + "href": "https://example.com/", + "host": "example.com", + "hostname": "example.com" + } + }, + { + "href": "https://example.com/", + "new_value": "xn--", + "expected": { + "href": "https://example.com/", + "host": "example.com", + "hostname": "example.com" + } } ], "port": [ diff --git a/url/resources/toascii.json b/url/resources/toascii.json index 4cb41e94cd4a0f..bca28b4a1e454a 100644 --- a/url/resources/toascii.json +++ b/url/resources/toascii.json @@ -160,23 +160,6 @@ "input": "a\u00ADb", "output": "ab" }, - { - "input": "a%C2%ADb", - "output": "ab" - }, - { - "comment": "Empty host after domain to ASCII", - "input": "\u00AD", - "output": null - }, - { - "input": "%C2%AD", - "output": null - }, - { - "input": "xn--", - "output": null - }, { "comment": "Interesting UseSTD3ASCIIRules=false cases", "input": "≠", diff --git a/url/resources/urltestdata.json b/url/resources/urltestdata.json index 19f9ecddbee187..eb414860f27c75 100644 --- a/url/resources/urltestdata.json +++ b/url/resources/urltestdata.json @@ -8892,5 +8892,36 @@ "protocol": "https:", "search": "", "username": "" + }, + { + "input": "https://a%C2%ADb/", + "base": "about:blank", + "hash": "", + "host": "ab", + "hostname": "ab", + "href": "https://ab/", + "origin": "https://ab", + "password": "", + "pathname": "/", + "port": "", + "protocol": "https:", + "search": "", + "username": "" + }, + { + "comment": "Empty host after domain to ASCII", + "input": "https://\u00AD/", + "base": "about:blank", + "failure": true + }, + { + "input": "https://%C2%AD/", + "base": "about:blank", + "failure": true + }, + { + "input": "https://xn--/", + "base": "about:blank", + "failure": true } ]