blob: 0f390bd2ac92131a9ac206c6499af0ad864e2576 [file] [log] [blame]
<html>
<body>
<p>Test worker invalid url exceptions. Should print two "PASS" statements.</p>
<div id=result></div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function log(message)
{
document.getElementById("result").innerHTML += message + "<br>";
}
try {
new SharedWorker("http://example.com/worker.js");
log("FAIL: No exception thrown when accessing a worker from another domain.");
} catch (error) {
if (error.code == 18)
log("PASS: Got security error.");
else
log("FAIL: Got error code " + error.code + ". Expected error code 18.");
}
try {
new SharedWorker("");
log("FAIL: No exception throw when accessing an invalid url.");
} catch (error) {
if (error.code == 12)
log("PASS: Got syntax error.");
else
log("FAIL: Got error code " + error.code + ". Expected error code 12.");
}
</script>
</body>
</html>