diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-10-06 06:57:51 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-10-06 06:57:51 +0200 |
commit | 0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25 (patch) | |
tree | c321601f04cbfd02fb6e12878e745dc49a612c86 /services/sync/tests/unit/test_node_reassignment.js | |
parent | 8860eddcee1417483cafd114f3a9ec127e0f1f74 (diff) | |
download | UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar.gz UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar.lz UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.tar.xz UXP-0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25.zip |
Import Tycho weave client
Diffstat (limited to 'services/sync/tests/unit/test_node_reassignment.js')
-rw-r--r-- | services/sync/tests/unit/test_node_reassignment.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/services/sync/tests/unit/test_node_reassignment.js b/services/sync/tests/unit/test_node_reassignment.js index 66d21b6f1..7fe5ed7ed 100644 --- a/services/sync/tests/unit/test_node_reassignment.js +++ b/services/sync/tests/unit/test_node_reassignment.js @@ -23,7 +23,7 @@ function run_test() { Log.repository.getLogger("Sync.Service").level = Log.Level.Trace; Log.repository.getLogger("Sync.SyncScheduler").level = Log.Level.Trace; initTestLogging(); - validate_all_future_pings(); + ensureLegacyIdentityManager(); Service.engineManager.register(RotaryEngine); @@ -92,12 +92,11 @@ function prepareServer() { function getReassigned() { try { return Services.prefs.getBoolPref("services.sync.lastSyncReassigned"); + } catch (ex if (ex.result == Cr.NS_ERROR_UNEXPECTED)) { + return false; } catch (ex) { - if (ex.result == Cr.NS_ERROR_UNEXPECTED) { - return false; - } do_throw("Got exception retrieving lastSyncReassigned: " + - Log.exceptionStr(ex)); + Utils.exceptionStr(ex)); } } @@ -107,7 +106,7 @@ function getReassigned() { * Runs `between` between the two. This can be used to undo deliberate failure * setup, detach observers, etc. */ -function* syncAndExpectNodeReassignment(server, firstNotification, between, +function syncAndExpectNodeReassignment(server, firstNotification, between, secondNotification, url) { let deferred = Promise.defer(); function onwards() { @@ -161,7 +160,7 @@ function* syncAndExpectNodeReassignment(server, firstNotification, between, yield deferred.promise; } -add_task(function* test_momentary_401_engine() { +add_task(function test_momentary_401_engine() { _("Test a failure for engine URLs that's resolved by reassignment."); let server = yield prepareServer(); let john = server.user("johndoe"); @@ -213,7 +212,7 @@ add_task(function* test_momentary_401_engine() { }); // This test ends up being a failing fetch *after we're already logged in*. -add_task(function* test_momentary_401_info_collections() { +add_task(function test_momentary_401_info_collections() { _("Test a failure for info/collections that's resolved by reassignment."); let server = yield prepareServer(); @@ -236,7 +235,7 @@ add_task(function* test_momentary_401_info_collections() { Service.infoURL); }); -add_task(function* test_momentary_401_storage_loggedin() { +add_task(function test_momentary_401_storage_loggedin() { _("Test a failure for any storage URL, not just engine parts. " + "Resolved by reassignment."); let server = yield prepareServer(); @@ -261,7 +260,7 @@ add_task(function* test_momentary_401_storage_loggedin() { Service.storageURL + "meta/global"); }); -add_task(function* test_momentary_401_storage_loggedout() { +add_task(function test_momentary_401_storage_loggedout() { _("Test a failure for any storage URL, not just engine parts. " + "Resolved by reassignment."); let server = yield prepareServer(); @@ -283,7 +282,7 @@ add_task(function* test_momentary_401_storage_loggedout() { Service.storageURL + "meta/global"); }); -add_task(function* test_loop_avoidance_storage() { +add_task(function test_loop_avoidance_storage() { _("Test that a repeated failure doesn't result in a sync loop " + "if node reassignment cannot resolve the failure."); @@ -383,7 +382,7 @@ add_task(function* test_loop_avoidance_storage() { yield deferred.promise; }); -add_task(function* test_loop_avoidance_engine() { +add_task(function test_loop_avoidance_engine() { _("Test that a repeated 401 in an engine doesn't result in a sync loop " + "if node reassignment cannot resolve the failure."); let server = yield prepareServer(); |