From 1a3e4d7706e51dc1b2e3caf718a8da4651ddc481 Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Tue, 19 Apr 2011 12:30:39 -0700 Subject: [PATCH] Bug 645918: attempt to fix random orange in test_bookmarks_engine. r=philiKON --- .../sync/tests/unit/test_bookmark_engine.js | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/services/sync/tests/unit/test_bookmark_engine.js b/services/sync/tests/unit/test_bookmark_engine.js index 10fa599c78e..e1a78e4fd81 100644 --- a/services/sync/tests/unit/test_bookmark_engine.js +++ b/services/sync/tests/unit/test_bookmark_engine.js @@ -14,7 +14,7 @@ function makeEngine() { } var syncTesting = new SyncTestingInfrastructure(makeEngine); -function test_ID_caching() { +add_test(function test_ID_caching() { _("Ensure that Places IDs are not cached."); let engine = new BookmarksEngine(); @@ -50,12 +50,12 @@ function test_ID_caching() { do_check_eq(newMobileID, store.idForGUID("mobile", false)); do_check_eq(store.GUIDForId(mobileID), "abcdefghijkl"); -} + run_next_test(); +}); -function test_processIncoming_error_orderChildren() { +add_test(function test_processIncoming_error_orderChildren() { _("Ensure that _orderChildren() is called even when _processIncoming() throws an error."); - do_test_pending(); Svc.Prefs.set("clusterURL", "http://localhost:8080/"); Svc.Prefs.set("username", "foo"); @@ -126,16 +126,15 @@ function test_processIncoming_error_orderChildren() { } finally { store.wipe(); - server.stop(do_test_finished); Svc.Prefs.resetBranch(""); Records.clearCache(); syncTesting = new SyncTestingInfrastructure(makeEngine); + server.stop(run_next_test); } -} +}); -function test_restorePromptsReupload() { +add_test(function test_restorePromptsReupload() { _("Ensure that restoring from a backup will reupload all records."); - do_test_pending(); Svc.Prefs.set("username", "foo"); Service.serverURL = "http://localhost:8080/"; Service.clusterURL = "http://localhost:8080/"; @@ -266,15 +265,15 @@ function test_restorePromptsReupload() { } finally { store.wipe(); - server.stop(do_test_finished); Svc.Prefs.resetBranch(""); Records.clearCache(); syncTesting = new SyncTestingInfrastructure(makeEngine); + server.stop(run_next_test); } -} +}); // Bug 632287. -function test_mismatched_types() { +add_test(function test_mismatched_types() { _("Ensure that handling a record that changes type causes deletion " + "then re-adding."); @@ -309,7 +308,6 @@ function test_mismatched_types() { "parentid": "toolbar" }; - do_test_pending(); Svc.Prefs.set("username", "foo"); Service.serverURL = "http://localhost:8080/"; Service.clusterURL = "http://localhost:8080/"; @@ -351,12 +349,12 @@ function test_mismatched_types() { } finally { store.wipe(); - server.stop(do_test_finished); Svc.Prefs.resetBranch(""); Records.clearCache(); syncTesting = new SyncTestingInfrastructure(makeEngine); + server.stop(run_next_test); } -} +}); function run_test() { initTestLogging("Trace"); @@ -364,8 +362,5 @@ function run_test() { CollectionKeys.generateNewKeys(); - test_processIncoming_error_orderChildren(); - test_ID_caching(); - test_mismatched_types(); - test_restorePromptsReupload(); + run_next_test(); }