diff options
Diffstat (limited to 'services/sync/tests/unit/test_utils_catch.js')
-rw-r--r-- | services/sync/tests/unit/test_utils_catch.js | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/services/sync/tests/unit/test_utils_catch.js b/services/sync/tests/unit/test_utils_catch.js index 5f50bf7e43..a10e5eb0d8 100644 --- a/services/sync/tests/unit/test_utils_catch.js +++ b/services/sync/tests/unit/test_utils_catch.js @@ -8,46 +8,38 @@ function run_test() { catch: Utils.catch, _log: { debug: function(str) { - didThrow = str.search(/^Exception/) == 0; + didThrow = str.search(/^Exception: /) == 0; }, info: function(str) { wasLocked = str.indexOf("Cannot start sync: already syncing?") == 0; } }, - func: function() { - return this.catch(function() { - rightThis = this == obj; - didCall = true; - return 5; - })(); - }, + func: function() this.catch(function() { + rightThis = this == obj; + didCall = true; + return 5; + })(), - throwy: function() { - return this.catch(function() { - rightThis = this == obj; - didCall = true; - throw 10; - })(); - }, + throwy: function() this.catch(function() { + rightThis = this == obj; + didCall = true; + throw 10; + })(), - callbacky: function() { - return this.catch(function() { - rightThis = this == obj; - didCall = true; - throw 10; - }, function(ex) { - wasTen = (ex == 10) - })(); - }, + callbacky: function() this.catch(function() { + rightThis = this == obj; + didCall = true; + throw 10; + }, function(ex) { + wasTen = (ex == 10) + })(), - lockedy: function() { - return this.catch(function() { - rightThis = this == obj; - didCall = true; - throw("Could not acquire lock."); - })(); - } + lockedy: function() this.catch(function() { + rightThis = this == obj; + didCall = true; + throw("Could not acquire lock."); + })() }; _("Make sure a normal call will call and return"); |