blob: e58e009bfd019961c438fe20ba1ac9c34b1489e6 [file] [log] [blame]
commit-queue@webkit.org94db5342013-04-25 09:51:36 +00001<html>
2<body>
3<p>Test EventSource with non-HTTP protocol schemes in the URL. Should print a series of PASS messages followed by DONE.</p>
4<script>
5function log(msg) {
6 document.body.innerHTML += msg + "<br>";
7}
8
9if (window.testRunner) {
10 testRunner.dumpAsText();
11 testRunner.waitUntilDone();
12}
13
14var count = 0;
15new EventSource("ftp://127.0.0.1").onerror =
16new EventSource("file:///etc/motd").onerror =
17new EventSource("localhost:8080/").onerror =
18new EventSource("tel:1234").onerror = function () {
19 if (this.readyState == EventSource.CLOSED) {
20 log("PASS: got error event and readyState is CLOSED");
21 } else {
22 log("FAIL: got error event but readyState is not CLOSED");
23 this.close();
24 }
25 if (count++ == 3) {
26 log("DONE");
27 end();
28 }
29};
30
31function end() {
32 if (window.testRunner)
33 testRunner.notifyDone();
34}
35</script>
36</body>
37</html>