diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /comm/mailnews/compose/test/unit/test_attachment_intl.js | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.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 '')
-rw-r--r-- | comm/mailnews/compose/test/unit/test_attachment_intl.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/comm/mailnews/compose/test/unit/test_attachment_intl.js b/comm/mailnews/compose/test/unit/test_attachment_intl.js new file mode 100644 index 0000000000..6ce352d4df --- /dev/null +++ b/comm/mailnews/compose/test/unit/test_attachment_intl.js @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* + * attachment test using non-ascii character + */ + +let nonAsciiUrl = "http://\u65e5\u672c\u8a9e.jp"; +let prettyResult = "\u65e5\u672c\u8a9e.jp"; + +function doAttachmentUrlTest() { + // handles non-ascii url in nsIMsgAttachment + + let attachment = Cc[ + "@mozilla.org/messengercompose/attachment;1" + ].createInstance(Ci.nsIMsgAttachment); + attachment.url = nonAsciiUrl; + + Assert.equal(attachment.url, nonAsciiUrl); +} + +function doPrettyNameTest() { + // handles non-ascii url in nsIMsgCompose + + let msgCompose = Cc["@mozilla.org/messengercompose/compose;1"].createInstance( + Ci.nsIMsgCompose + ); + let params = Cc[ + "@mozilla.org/messengercompose/composeparams;1" + ].createInstance(Ci.nsIMsgComposeParams); + msgCompose.initialize(params); + + Assert.equal( + msgCompose.AttachmentPrettyName(nonAsciiUrl, null), + prettyResult + ); +} + +function run_test() { + doAttachmentUrlTest(); + doPrettyNameTest(); + + do_test_finished(); +} |