summaryrefslogtreecommitdiffstats
path: root/comm/mailnews/addrbook/test/unit/test_bug448165.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /comm/mailnews/addrbook/test/unit/test_bug448165.js
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'comm/mailnews/addrbook/test/unit/test_bug448165.js')
-rw-r--r--comm/mailnews/addrbook/test/unit/test_bug448165.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/comm/mailnews/addrbook/test/unit/test_bug448165.js b/comm/mailnews/addrbook/test/unit/test_bug448165.js
new file mode 100644
index 0000000000..57337f7fa1
--- /dev/null
+++ b/comm/mailnews/addrbook/test/unit/test_bug448165.js
@@ -0,0 +1,18 @@
+/**
+ * A simple test to check for a regression of bug 448165: Mailnews crashes in
+ * nsAbMDBDirectory::DeleteCards if aCards is null
+ */
+function run_test() {
+ // get the Personal Address Book
+ let pab = MailServices.ab.getDirectory(kPABData.URI);
+ Assert.ok(pab instanceof Ci.nsIAbDirectory);
+ try {
+ pab.deleteCards(null); // this should throw an error
+ do_throw(
+ "Error, deleteCards should throw an error when null is passed to it"
+ );
+ } catch (e) {
+ // make sure the correct error message was thrown
+ Assert.equal(e.result, Cr.NS_ERROR_XPC_CANT_CONVERT_PRIMITIVE_TO_ARRAY);
+ }
+}