michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: _("Making sure a failing sync reports a useful error"); michael@0: Cu.import("resource://services-sync/engines/bookmarks.js"); michael@0: Cu.import("resource://services-sync/service.js"); michael@0: michael@0: function run_test() { michael@0: let engine = new BookmarksEngine(Service); michael@0: engine._syncStartup = function() { michael@0: throw "FAIL!"; michael@0: }; michael@0: michael@0: try { michael@0: _("Try calling the sync that should throw right away"); michael@0: engine._sync(); michael@0: do_throw("Should have failed sync!"); michael@0: } michael@0: catch(ex) { michael@0: _("Making sure what we threw ended up as the exception:", ex); michael@0: do_check_eq(ex, "FAIL!"); michael@0: } michael@0: }