mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
Bug 616568: commit test that slipped through hg add. r=philiKON
This commit is contained in:
parent
0b37a22351
commit
3b694d6bd8
32
services/sync/tests/unit/test_service_sync_locked.js
Normal file
32
services/sync/tests/unit/test_service_sync_locked.js
Normal file
@ -0,0 +1,32 @@
|
||||
Cu.import("resource://services-sync/main.js");
|
||||
|
||||
function run_test() {
|
||||
let debug = [];
|
||||
let info = [];
|
||||
|
||||
function augmentLogger(old) {
|
||||
let d = old.debug;
|
||||
let i = old.info;
|
||||
old.debug = function(m) { debug.push(m); d.call(old, m); }
|
||||
old.info = function(m) { info.push(m); i.call(old, m); }
|
||||
return old;
|
||||
}
|
||||
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
|
||||
augmentLogger(Weave.Service._log);
|
||||
|
||||
// Avoid daily ping
|
||||
Weave.Svc.Prefs.set("lastPing", Math.floor(Date.now() / 1000));
|
||||
|
||||
_("Check that sync will log appropriately if already in 'progress'.");
|
||||
Weave.Service._locked = true;
|
||||
Weave.Service.sync();
|
||||
Weave.Service._locked = false;
|
||||
|
||||
do_check_eq(debug[debug.length - 3],
|
||||
"Exception: Could not acquire lock. Label: \"service.js: login\". No traceback available");
|
||||
do_check_eq(info[info.length - 1],
|
||||
"Cannot start sync: already syncing?");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user