From 0f08bc57ca6e9a3895a600b269d9c3d1be447772 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 16 Nov 2012 15:29:21 -0500 Subject: [PATCH] Bug 663291 ride-along: reactivate the web worker error propagation tests (from bug 595394, disabled in bug 692605). r=ted --HG-- extra : rebase_source : a01f9c3461f4af611e7fdeb442d001bb694a99ec --- dom/workers/test/errorPropagation_iframe.html | 2 +- dom/workers/test/test_errorPropagation.html | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) 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); }