| <html> |
| <script> |
| // Note that port "1" is tested by the initial load. |
| var blockedPorts = new Array(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, 3659, 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:1/test.jpg" onError="nextTest();"></img> |
| </body> |
| </html> |