summaryrefslogtreecommitdiffstats
path: root/services/sync/tests/unit/test_node_reassignment.js
diff options
context:
space:
mode:
authorwicknix <39230578+wicknix@users.noreply.github.com>2019-04-15 18:58:07 -0500
committerGitHub <noreply@github.com>2019-04-15 18:58:07 -0500
commit5a1843c9f9e323627f9c35529e6a8c853d4dbb0d (patch)
tree62de3cd7cb8a6f75e568863bb73ca2deb80d87a9 /services/sync/tests/unit/test_node_reassignment.js
parent065f6f9e5ebc1ed6cfaadaf7851b6021fa94a013 (diff)
parent095ea556855b38138e39e713f482eb440f7da9b2 (diff)
downloadUXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.gz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.lz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.tar.xz
UXP-5a1843c9f9e323627f9c35529e6a8c853d4dbb0d.zip
Merge pull request #1 from MoonchildProductions/master
keep up with mc
Diffstat (limited to 'services/sync/tests/unit/test_node_reassignment.js')
-rw-r--r--services/sync/tests/unit/test_node_reassignment.js23
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();