blob: 905ce3c0ca02b61fca2545694d9c1af5004e8c21 [file] [log] [blame]
<html>
<body>
<p>Test EventSource in a worker.</p>
<div id="result"></div>
<script>
function log(msg) {
document.getElementById("result").innerHTML += msg + "<br>";
}
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
var worker = new Worker("resources/simple-worker.js");
worker.onmessage = function (evt) {
if (evt.data == "hello")
log("PASS");
else
log("FAIL");
end();
}
worker.onerror = function () {
log("FAIL");
end();
}
function end() {
if (window.testRunner)
testRunner.notifyDone();
}
</script>
</body>
</html>