From 57cf89779ba43dc0b4804e2a0ecaf9f7c37e8730 Mon Sep 17 00:00:00 2001 From: Edward Lee Date: Tue, 22 Jun 2010 18:28:37 -0700 Subject: [PATCH] Bug 573679 - Fix tests to pass on trunk Get a profile for xpcshell tests so that login manager works (and probably other stuff). Fix up anno test from this change to use a real bookmark id. --- services/sync/tests/unit/head_appinfo.js | 4 +++- services/sync/tests/unit/test_utils_anno.js | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/services/sync/tests/unit/head_appinfo.js b/services/sync/tests/unit/head_appinfo.js index 30a9cbce901..d6a2ef5f929 100644 --- a/services/sync/tests/unit/head_appinfo.js +++ b/services/sync/tests/unit/head_appinfo.js @@ -7,8 +7,10 @@ if (this.do_load_httpd_js == null) { Cu = Components.utils; Cu.import("resource://harness/modules/httpd.js"); } -else +else { do_load_httpd_js(); + do_get_profile(); +} Cu.import("resource://gre/modules/XPCOMUtils.jsm"); diff --git a/services/sync/tests/unit/test_utils_anno.js b/services/sync/tests/unit/test_utils_anno.js index 2c1972c75c6..008ce6714e7 100644 --- a/services/sync/tests/unit/test_utils_anno.js +++ b/services/sync/tests/unit/test_utils_anno.js @@ -2,15 +2,15 @@ _("Make sure various combinations of anno arguments do the right get/set for pag Cu.import("resource://services-sync/util.js"); function run_test() { - _("set an anno on an item 1"); - Utils.anno(1, "anno", "hi"); - do_check_eq(Utils.anno(1, "anno"), "hi"); - _("create a bookmark to a url so it exists"); let url = "about:"; let bmkid = Svc.Bookmark.insertBookmark(Svc.Bookmark.unfiledBookmarksFolder, Utils.makeURI(url), -1, ""); + _("set an anno on the bookmark "); + Utils.anno(bmkid, "anno", "hi"); + do_check_eq(Utils.anno(bmkid, "anno"), "hi"); + _("set an anno on a url"); Utils.anno(url, "tation", "hello"); do_check_eq(Utils.anno(url, "tation"), "hello"); @@ -24,7 +24,7 @@ function run_test() { do_check_eq(Utils.anno(url, "tation"), "bye!"); _("sanity check that the item anno is still there"); - do_check_eq(Utils.anno(1, "anno"), "hi"); + do_check_eq(Utils.anno(bmkid, "anno"), "hi"); _("invalid uris don't get annos"); let didThrow = false;