diff options
Diffstat (limited to '')
-rw-r--r-- | comm/mailnews/addrbook/test/unit/test_bug534822.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/comm/mailnews/addrbook/test/unit/test_bug534822.js b/comm/mailnews/addrbook/test/unit/test_bug534822.js new file mode 100644 index 0000000000..4c18f64b5d --- /dev/null +++ b/comm/mailnews/addrbook/test/unit/test_bug534822.js @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* + * Tests for bug 534822 - non-built-in address books specified in preferences + * don't appear in address book lists. + */ + +function run_test() { + // Read in the prefs that will be default. + let specialPrefs = do_get_file("data/bug534822prefs.js"); + + var profileDir = do_get_profile(); + specialPrefs.copyTo(profileDir, ""); + + specialPrefs = profileDir; + specialPrefs.append("bug534822prefs.js"); + + Services.prefs.readUserPrefsFromFile(specialPrefs); + + // Now load the ABs and check we've got all of them. + let results = [ + { name: "extension", result: false }, + { name: kPABData.dirName, result: false }, + { name: kCABData.dirName, result: false }, + ]; + + for (let dir of MailServices.ab.directories) { + for (let i = 0; i < results.length; ++i) { + if (results[i].name == dir.dirName) { + Assert.ok(!results[i].result); + results[i].result = true; + } + } + } + + results.forEach(function (result) { + Assert.ok(result.result); + }); +} |