Bug 849094: Tests. r=bent

This commit is contained in:
Kyle Huey 2013-03-12 13:33:40 -07:00
parent 2ade1f9456
commit 157ed8f9d7
2 changed files with 19 additions and 3 deletions

View File

@ -4,6 +4,13 @@
*/
onclose = function() {
postMessage("closed");
// Try to open a new worker.
try {
var worker = new Worker("close_worker.js");
throw new Error("We shouldn't get here!");
} catch (e) {
// pass
}
};
setTimeout(function () {

View File

@ -1,5 +1,9 @@
/**
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
msg = null;
var errors = 6;
var errors = 5;
onerror = function(event) {
ok(true, msg);
@ -35,7 +39,12 @@ worker.onmessage = function(event) {
}
msg = "Loading data:something";
worker = new Worker("data:application/javascript;base64,ZHVtcCgnaGVsbG8gd29ybGQnKQo=");
worker = new Worker("javascript:dump(123);");
try {
worker = new Worker("data:application/javascript;base64,ZHVtcCgnaGVsbG8gd29ybGQnKQo=");
ok(false, "Should have thrown!");
} catch (e) {
ok(true, "Threw as expected.");
}
worker = new Worker("javascript:dump(123);");
SimpleTest.waitForExplicitFinish();