blob: 8bad7ef404fa1a936b1e30700fe338984095d105 [file] [log] [blame]
<html>
<body>
<p>Test EventSource constructor functionality. Should print a series of PASS messages followed by DONE.</p>
<div id="result"></div>
<script>
function log(msg) {
document.getElementById("result").innerHTML += msg + "<br>";
}
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
try {
new EventSource();
log("FAIL: no exception when trying to construct an EventSource without argument");
}
catch (ex) {
log("PASS: missing argument to EventSource constructor resulted in an exception (" + ex + ")");
}
try {
new EventSource("");
log("FAIL: no exception when passing an empty string to the EventSource constructor");
}
catch (ex) {
log("PASS: passing an empty string to the EventSource constructor resulted in an exception (" + ex + ")");
}
try {
new EventSource("http://webserver:eighty/");
log("FAIL: no exception when passing an invalid URL to the EventSource constructor");
}
catch (ex) {
log("PASS: passing an invalid URL to the EventSource constructor resulted in an exception (" + ex + ")");
log("DONE");
}
if (window.layoutTestController)
layoutTestController.notifyDone();
</script>
</body>
</html>