diff --git a/dom/browser-element/mochitest/async.js b/dom/browser-element/mochitest/async.js index 269a04811405..dfbc3a0f2406 100644 --- a/dom/browser-element/mochitest/async.js +++ b/dom/browser-element/mochitest/async.js @@ -62,11 +62,7 @@ .then( result => step(gen.next(result)), error => { - try { - step(gen.throw(error)); - } catch (err) { - throw err; - } + step(gen.throw(error)); } ) .catch(err => reject(err)); diff --git a/dom/canvas/test/test_2d_composite_canvaspattern_setTransform.html b/dom/canvas/test/test_2d_composite_canvaspattern_setTransform.html index 6e46774d04da..2c525c2362e8 100644 --- a/dom/canvas/test/test_2d_composite_canvaspattern_setTransform.html +++ b/dom/canvas/test/test_2d_composite_canvaspattern_setTransform.html @@ -60,8 +60,8 @@ function runTests() { try { test_2d_canvaspattern_setTransform(); } catch(e) { - throw e; ok(false, "unexpected exception thrown in: test_2d_canvaspattern_setTransform"); + throw e; } SimpleTest.finish(); } @@ -75,4 +75,3 @@ document.all; window.p = new Path2D(); - diff --git a/dom/canvas/test/test_canvas.html b/dom/canvas/test/test_canvas.html index 95ceda4db3c0..9426667bfc7f 100644 --- a/dom/canvas/test/test_canvas.html +++ b/dom/canvas/test/test_canvas.html @@ -25606,14 +25606,14 @@ function runTests() { try { test_getImageData_after_zero_canvas(); } catch(e) { - throw e; ok(false, "unexpected exception thrown in: test_getImageData_after_zero_canvas"); + throw e; } try { test_opaque(); } catch(e) { - throw e; ok(false, "unexpected exception thrown in: test_opaque"); + throw e; } try { test_2d_transformation_reset_transform(); @@ -25764,8 +25764,8 @@ function runTests() { try { test_2d_clearRect_testdoubleprecision(); } catch(e) { - throw e; ok(false, "unexpected exception thrown in: test_2d_clearRect_testdoubleprecision"); + throw e; } //run the asynchronous tests diff --git a/dom/canvas/test/test_canvas_focusring.html b/dom/canvas/test/test_canvas_focusring.html index ef7cddd2e895..0e9566ac2914 100644 --- a/dom/canvas/test/test_canvas_focusring.html +++ b/dom/canvas/test/test_canvas_focusring.html @@ -60,8 +60,8 @@ function runTests() { try { test_drawFocusIfNeeded_canvas(); } catch(e) { - throw e; ok(false, "unexpected exception thrown in: test_drawFocusIfNeeded_canvas"); + throw e; } SpecialPowers.setBoolPref("canvas.focusring.enabled", false); diff --git a/dom/canvas/test/test_hitregion_canvas.html b/dom/canvas/test/test_hitregion_canvas.html index 49cefb0b46c6..0ac826164377 100644 --- a/dom/canvas/test/test_hitregion_canvas.html +++ b/dom/canvas/test/test_hitregion_canvas.html @@ -72,8 +72,8 @@ function runTests() { try { test_hitregions(); } catch(e) { - throw e; ok(false, "unexpected exception thrown in: test_hitregions"); + throw e; } SimpleTest.finish(); } diff --git a/dom/websocket/tests/websocket_helpers.js b/dom/websocket/tests/websocket_helpers.js index 24ef3ba4a43a..18f9f5a835f5 100644 --- a/dom/websocket/tests/websocket_helpers.js +++ b/dom/websocket/tests/websocket_helpers.js @@ -28,23 +28,19 @@ function ignoreError(e) {} function CreateTestWS(ws_location, ws_protocol) { var ws; - try { - if (ws_protocol == undefined) { - ws = new WebSocket(ws_location); - } else { - ws = new WebSocket(ws_location, ws_protocol); - } - - ws._testNumber = current_test; - ok(true, "Created websocket for test " + ws._testNumber + "\n"); - - ws.onerror = function(e) { - ok(false, "onerror called on test " + e.target._testNumber + "!"); - }; - } catch (e) { - throw e; + if (ws_protocol == undefined) { + ws = new WebSocket(ws_location); + } else { + ws = new WebSocket(ws_location, ws_protocol); } + ws._testNumber = current_test; + ok(true, "Created websocket for test " + ws._testNumber + "\n"); + + ws.onerror = function(e) { + ok(false, "onerror called on test " + e.target._testNumber + "!"); + }; + return ws; }