diff --git a/dom/workers/test/errorPropagation_iframe.html b/dom/workers/test/errorPropagation_iframe.html index c5f6884875c0..5c4a7962f35f 100644 --- a/dom/workers/test/errorPropagation_iframe.html +++ b/dom/workers/test/errorPropagation_iframe.html @@ -18,8 +18,8 @@ type: "window", data: { message: message, filename: filename, lineno: lineno } }); - return true; } + return false; }; worker = new Worker("errorPropagation_worker.js"); diff --git a/dom/workers/test/test_errorPropagation.html b/dom/workers/test/test_errorPropagation.html index 7e1aafe25d3b..c20dac94777e 100644 --- a/dom/workers/test/test_errorPropagation.html +++ b/dom/workers/test/test_errorPropagation.html @@ -36,6 +36,10 @@ } else if (event.type == "window") { windowErrorCount++; + workerFrame.stop(); + // do this via executeSoon to give the workers a chance to + // be cleaned up + SimpleTest.executeSoon(SimpleTest.endMonitorConsole); } else { ok(false, "Bad event type: " + event.type); @@ -45,17 +49,27 @@ is(event.data.filename, errorFilename, "Correct message event.filename"); is(event.data.lineno, errorLineno, "Correct message event.lineno"); + } - if (windowErrorCount == 1) { - is(scopeErrorCount, workerCount, "Good number of scope errors"); - is(workerErrorCount, workerCount, "Good number of worker errors"); - workerFrame.stop(); - SimpleTest.finish(); - } + function finish() { + is(scopeErrorCount, workerCount, "Good number of scope errors"); + is(workerErrorCount, workerCount, "Good number of worker errors"); + is(windowErrorCount, 1, "Good number of window errors"); + SimpleTest.finish(); } function workerFrameLoaded() { workerFrame = document.getElementById("workerFrame").contentWindow; + + SimpleTest.monitorConsole(finish, [ + { 'isScriptError': true, + 'isWarning': false, + 'isException': false, + 'sourceName': errorFilename, + 'lineNumber': errorLineno, + 'errorMessage': errorMessage } + ]); + workerFrame.start(workerCount, messageListener); }