blob: 74eac33cf512eace1aad821f6b70918f31f5a3e3 [file] [log] [blame]
<html>
<script>
var blockedPorts = new Array(1, 7, 9, 11, 13, 15, 17, 19, 20,
21, 22, 23, 25, 37, 42, 43, 53, 77, 79, 87, 95, 101, 102,
103, 104, 109, 110, 111, 113, 115, 117, 119, 123, 135, 139,
143, 179, 389, 465, 512, 513, 514, 515, 526, 530, 531, 532,
540, 556, 563, 587, 601, 636, 993, 995, 2049, 4045, 6000, 0);
var baseURL = "255.255.255.255";
var currentPort = 0;
if (window.layoutTestController) {
layoutTestController.waitUntilDone();
layoutTestController.dumpResourceLoadCallbacks();
}
function nextTest() {
if (!blockedPorts[currentPort]) {
ftpTest();
return;
}
var newURL = "http://" + baseURL + ":" + blockedPorts[currentPort] + "/test.jpg";
currentPort++;
testIMG.src = newURL;
}
function ftpTest() {
testIMG.setAttribute("onError", "ftp21Test();");
var newURL = "ftp://" + baseURL + "/test.jpg";
testIMG.src = newURL;
}
function ftp21Test() {
testIMG.setAttribute("onError", "ftp22Test();");
var newURL = "ftp://" + baseURL + ":21/test.jpg";
testIMG.src = newURL;
}
function ftp22Test() {
testIMG.setAttribute("onError", "finishTesting();");
var newURL = "ftp://" + baseURL + ":22/test.jpg";
testIMG.src = newURL;
}
function finishTesting() {
if (window.layoutTestController) {
layoutTestController.dumpAsText();
setTimeout("layoutTestController.notifyDone()", 0);
}
}
</script>
<body>
<p>This test attempts to change the src of an IMG tag to all black listed ports to confirm that WebKit returns the
correct error for them - blocked instead of cannot find. It also tries the FTP ports for exemptions. Due to the
nature of this test, the results can only be processed automatically via DumpRenderTree
</p>
<img id="testIMG" src="http://255.255.255.255/test.jpg" onError="nextTest();"></img>
</body>
</html>