зеркало из https://github.com/mozilla/gecko-dev.git
Bug 646910: attempt to fix random orange in test_clients_engine. r=philiKON
--HG-- extra : transplant_source : %DC%16%D0%0F%E3%82%8F%18%CC%1B4%D4%A4%BF%1Aw%E0%EAH%5C
This commit is contained in:
Родитель
2bc553bf08
Коммит
f26170f7e3
|
@ -7,9 +7,9 @@ Cu.import("resource://services-sync/engines/clients.js");
|
|||
Cu.import("resource://services-sync/service.js");
|
||||
|
||||
const MORE_THAN_CLIENTS_TTL_REFRESH = 691200; // 8 days
|
||||
const LESS_THAN_CLIENTS_TTL_REFRESH = 86400; // 1 day
|
||||
const LESS_THAN_CLIENTS_TTL_REFRESH = 86400; // 1 day
|
||||
|
||||
function test_bad_hmac() {
|
||||
add_test(function test_bad_hmac() {
|
||||
_("Ensure that Clients engine deletes corrupt records.");
|
||||
let global = new ServerWBO('global',
|
||||
{engines: {clients: {version: Clients.version,
|
||||
|
@ -41,7 +41,6 @@ function test_bad_hmac() {
|
|||
};
|
||||
|
||||
let server = httpd_setup(handlers);
|
||||
do_test_pending();
|
||||
|
||||
try {
|
||||
let passphrase = "abcdeabcdeabcdeabcdeabcdea";
|
||||
|
@ -133,15 +132,15 @@ function test_bad_hmac() {
|
|||
do_check_false(oldKey.equals(newKey));
|
||||
|
||||
} finally {
|
||||
server.stop(do_test_finished);
|
||||
Svc.Prefs.resetBranch("");
|
||||
Records.clearCache();
|
||||
server.stop(run_next_test);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function test_properties() {
|
||||
add_test(function test_properties() {
|
||||
_("Test lastRecordUpload property");
|
||||
try {
|
||||
_("Test lastRecordUpload property");
|
||||
do_check_eq(Svc.Prefs.get("clients.lastRecordUpload"), undefined);
|
||||
do_check_eq(Clients.lastRecordUpload, 0);
|
||||
|
||||
|
@ -150,10 +149,11 @@ function test_properties() {
|
|||
do_check_eq(Clients.lastRecordUpload, Math.floor(now / 1000));
|
||||
} finally {
|
||||
Svc.Prefs.resetBranch("");
|
||||
run_next_test();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function test_sync() {
|
||||
add_test(function test_sync() {
|
||||
_("Ensure that Clients engine uploads a new client record once a week.");
|
||||
Svc.Prefs.set("clusterURL", "http://localhost:8080/");
|
||||
Svc.Prefs.set("username", "foo");
|
||||
|
@ -172,8 +172,6 @@ function test_sync() {
|
|||
server.registerPathHandler(
|
||||
"/1.1/foo/storage/clients/" + Clients.localID, clientwbo.handler());
|
||||
|
||||
do_test_pending();
|
||||
|
||||
try {
|
||||
|
||||
_("First sync, client record is uploaded");
|
||||
|
@ -203,17 +201,14 @@ function test_sync() {
|
|||
do_check_eq(Clients.lastRecordUpload, yesterday);
|
||||
|
||||
} finally {
|
||||
server.stop(do_test_finished);
|
||||
Svc.Prefs.resetBranch("");
|
||||
Records.clearCache();
|
||||
server.stop(run_next_test);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Engine.Clients").level = Log4Moz.Level.Trace;
|
||||
test_bad_hmac();
|
||||
test_properties();
|
||||
test_sync();
|
||||
run_next_test();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче