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