38 lines
874 B
HTML
38 lines
874 B
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-16">
|
||
<!-- Set the base so that the current URL does not affect the tests. -->
|
||
<base href="">
|
||
</head>
|
||
<body>
|
||
|
||
<script>
|
||
if (window.testRunner)
|
||
testRunner.dumpAsText();
|
||
|
||
// Start the bidding at 42 for no particular reason.
|
||
var lastID = 42;
|
||
|
||
function canonicalize(url)
|
||
{
|
||
var id = ++lastID;
|
||
document.write("<a id='" + id + "' href='" + url + "'></a>");
|
||
return document.getElementById(id).href;
|
||
}
|
||
|
||
// Those are all invalid URLs. They should not be accepted by the parser.
|
||
var testSet = [
|
||
'http://.com',
|
||
'http://www.اast.fm'
|
||
];
|
||
|
||
document.write("Test passes if all the invalid urls are converted to about:blank.<br>");
|
||
for (var i = 0; i < testSet.length; ++i) {
|
||
src = canonicalize(testSet[i]);
|
||
document.write(src + "<br>");
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|