# HG changeset patch # User RĂ©mi Cardona # Date 1431528121 -7200 # Node ID e1076102bd84819dd01fa277de1986b4f7cf1568 # Parent 59bf206996c81f7733502a8b04f2eabb4f53cc51 [web/test] Stop testing that exceptions raised in Deferred callbacks call errback They no longer do as of changeset 7f1f7f710b16. Related to #5533303. diff -r 59bf206996c8 -r e1076102bd84 web/test/jstests/test_ajax.js --- a/web/test/jstests/test_ajax.js Wed May 13 16:38:28 2015 +0200 +++ b/web/test/jstests/test_ajax.js Wed May 13 16:42:01 2015 +0200 @@ -155,14 +155,10 @@ test('test addErrback', function() { expect(1); stop(); - var d = jQuery('#main').loadxhtml(BASE_URL + 'cwsoftwareroot/web/test/jstests/ajax_url0.html'); + var d = jQuery('#main').loadxhtml(BASE_URL + 'cwsoftwareroot/web/test/jstests/nonexistent.html'); d.addCallback(function() { - // throw an exception to start errback chain - try { - throw new Error(); - } finally { - start(); - }; + // should not be executed + ok(false, "callback is executed"); }); d.addErrback(function() { try { @@ -173,8 +169,8 @@ }); }); - test('test callback / errback execution order', function() { - expect(4); + test('test callback execution order', function() { + expect(3); var counter = 0; stop(); var d = jQuery('#main').loadxhtml(BASE_URL + 'cwsoftwareroot/web/test/jstests/ajax_url0.html'); @@ -187,21 +183,11 @@ } ); d.addCallback(function() { - equals(++counter, 2); // should be executed and break callback chain - throw new Error(); + equals(++counter, 2); }); d.addCallback(function() { - // should not be executed since second callback raised an error - ok(false, "callback is executed"); - }); - d.addErrback(function() { - // should be executed after the second callback equals(++counter, 3); }); - d.addErrback(function() { - // should be executed after the first errback - equals(++counter, 4); - }); }); test('test already included resources are ignored (ajax_url1.html)', function() {