summaryrefslogtreecommitdiffstats
path: root/services/sync/tests/unit/test_corrupt_keys.js
diff options
context:
space:
mode:
Diffstat (limited to 'services/sync/tests/unit/test_corrupt_keys.js')
-rw-r--r--services/sync/tests/unit/test_corrupt_keys.js16
1 files changed, 5 insertions, 11 deletions
diff --git a/services/sync/tests/unit/test_corrupt_keys.js b/services/sync/tests/unit/test_corrupt_keys.js
index 009461c2a..2db080a8f 100644
--- a/services/sync/tests/unit/test_corrupt_keys.js
+++ b/services/sync/tests/unit/test_corrupt_keys.js
@@ -14,7 +14,7 @@ Cu.import("resource://services-sync/util.js");
Cu.import("resource://testing-common/services/sync/utils.js");
Cu.import("resource://gre/modules/Promise.jsm");
-add_task(function* test_locally_changed_keys() {
+add_task(function test_locally_changed_keys() {
let passphrase = "abcdeabcdeabcdeabcdeabcdea";
let hmacErrorCount = 0;
@@ -51,7 +51,7 @@ add_task(function* test_locally_changed_keys() {
}]}]};
delete Svc.Session;
Svc.Session = {
- getBrowserState: () => JSON.stringify(myTabs)
+ getBrowserState: function () JSON.stringify(myTabs)
};
setBasicCredentials("johndoe", "password", passphrase);
@@ -59,7 +59,6 @@ add_task(function* test_locally_changed_keys() {
Service.clusterURL = server.baseURI;
Service.engineManager.register(HistoryEngine);
- Service.engineManager.unregister("addons");
function corrupt_local_keys() {
Service.collectionKeys._default.keyPair = [Svc.Crypto.generateRandomKey(),
@@ -87,7 +86,7 @@ add_task(function* test_locally_changed_keys() {
do_check_true(Service.isLoggedIn);
// Sync should upload records.
- yield sync_and_validate_telem();
+ Service.sync();
// Tabs exist.
_("Tabs modified: " + johndoe.modified("tabs"));
@@ -140,9 +139,7 @@ add_task(function* test_locally_changed_keys() {
_("HMAC error count: " + hmacErrorCount);
// Now syncing should succeed, after one HMAC error.
- let ping = yield wait_for_ping(() => Service.sync(), true);
- equal(ping.engines.find(e => e.name == "history").incoming.applied, 5);
-
+ Service.sync();
do_check_eq(hmacErrorCount, 1);
_("Keys now: " + Service.collectionKeys.keyForCollection("history").keyPair);
@@ -186,9 +183,7 @@ add_task(function* test_locally_changed_keys() {
Service.lastHMACEvent = 0;
_("Syncing...");
- ping = yield sync_and_validate_telem(true);
-
- do_check_eq(ping.engines.find(e => e.name == "history").incoming.failed, 5);
+ Service.sync();
_("Keys now: " + Service.collectionKeys.keyForCollection("history").keyPair);
_("Server keys have been updated, and we skipped over 5 more HMAC errors without adjusting history.");
do_check_true(johndoe.modified("crypto") > old_key_time);
@@ -209,7 +204,6 @@ add_task(function* test_locally_changed_keys() {
function run_test() {
let logger = Log.repository.rootLogger;
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
- validate_all_future_pings();
ensureLegacyIdentityManager();