chromium/third_party/blink/web_tests/fast/url/invalid-urls-utf8.html

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="resources/utilities.js"></script>
<!-- Set the base so that the current URL does not affect the tests. -->
<base href="">
</head>
<body>

<script>
description("This ensure we do not mess up the bytes when an URL is partially parsed and is invalid.")

// Those are all invalid URLs. They should not be partially modified by the parser.
var testSet = [
    // Empty Authority for a standard hierarchical URL.
    'http:///',
    'https:///',
    'ftp:///',
    'gopher:///',
    'ws:///',
    'wss:///',
    '  wss:///  ',

    // Invalid Authority.
    'foo://user:password@[xxxxx]/',
    '    foo://user:password@[xxxxx]/    ',

    // The '?' is a path separator and make sure the hostname is not encoded in punicode. The hostname is an invalid IPV6 hostname.
    'foo://user:password@[?tête à tête/',
    'foo://user:password@[?tête à tête]/',
    'foo://user:password@host:tête à tête/',
    'foo://user:password@host:80tête à tête',
    'foo://user:password@host:tête à tête/',
    'foo://user:password@host:80tête à tête',
    // The schemes "ws:", "ftp:", "http:", "https:" take a shortcut during parsing so we test them separately.
    'ws://host:tête',
    'ftp://host:tête',
    'http://host:tête',
    'https://host:tête',
];

for (var i = 0; i < testSet.length; ++i) {
    src = canonicalize(testSet[i]);
    expected = testSet[i];
    shouldBe('src', 'expected');
}

successfullyParsed = true;
</script>
</body>
</html>