Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / eventsource / script-tests / eventsource-cors-non-http.js
1 if (self.importScripts)
2     importScripts("/js-test-resources/js-test.js");
3
4 description("Test EventSource with non-HTTP protocol schemes in the URL.");
5
6 self.jsTestIsAsync = true;
7
8 var es, count = 0;
9
10 new EventSource("ftp://127.0.0.1").onerror =
11 new EventSource("file:///etc/motd").onerror =
12 new EventSource("localhost:8080/").onerror =
13 new EventSource("tel:1234").onerror = function () {
14     es = this;
15     shouldBe("es.readyState", "EventSource.CLOSED");
16     if (count++ == 3)
17         finishJSTest();
18 };