зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1648493 - tests r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D88299
This commit is contained in:
Родитель
725671b486
Коммит
af22c7c5f0
|
@ -487,5 +487,15 @@
|
|||
is(u.toJSON(), "http://www.example.org/", "URL.toJSON()");
|
||||
is(JSON.stringify(u), "\"http://www.example.org/\"", "JSON.stringify(u) works");
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// bug 1648493
|
||||
var url = new URL("http://example.com/");
|
||||
url.protocol = 'file'
|
||||
url.protocol = 'resource'
|
||||
url.password = 'ê'
|
||||
url.username = 'ç'
|
||||
url.protocol = 't'
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1271,3 +1271,29 @@ add_task(async function test_emptyHostWithURLType() {
|
|||
"A pseudo-empty host is not allowed for URLTYPE_AUTHORITY"
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function test_bug1648493() {
|
||||
let url = stringToURL("https://example.com/");
|
||||
url = url
|
||||
.mutate()
|
||||
.setScheme("file")
|
||||
.finalize();
|
||||
url = url
|
||||
.mutate()
|
||||
.setScheme("resource")
|
||||
.finalize();
|
||||
url = url
|
||||
.mutate()
|
||||
.setPassword("ê")
|
||||
.finalize();
|
||||
url = url
|
||||
.mutate()
|
||||
.setUsername("ç")
|
||||
.finalize();
|
||||
url = url
|
||||
.mutate()
|
||||
.setScheme("t")
|
||||
.finalize();
|
||||
equal(url.spec, "t://%C3%83%C2%A7:%C3%83%C2%AA@example.com/");
|
||||
equal(url.username, "%C3%83%C2%A7");
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче