Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / eventsource / eventsource-cors-non-http.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../js-test-resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Test EventSource with non-HTTP protocol schemes in the URL.");
9 self.jsTestIsAsync = true;
10
11 var count = 0;
12 new EventSource("ftp://127.0.0.1").onerror =
13 new EventSource("file:///etc/motd").onerror =
14 new EventSource("localhost:8080/").onerror =
15 new EventSource("tel:1234").onerror = function () {
16     if (this.readyState == EventSource.CLOSED) {
17         testPassed("got error event and readyState is CLOSED");
18     } else {
19         testFailed("got error event but readyState is not CLOSED");
20         this.close();
21     }
22     if (count++ == 3)
23         finishJSTest();
24 };
25 </script>
26 </body>
27 </html>