File indexing completed on 2024-06-02 05:29:13

0001 /*
0002   SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
0003   SPDX-FileCopyrightText: 2009 Leo Franchi <lfranchi@kde.org>
0004 
0005   SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include <QObject>
0011 
0012 namespace MessageComposer
0013 {
0014 class Composer;
0015 }
0016 
0017 class CryptoComposerTest : public QObject
0018 {
0019     Q_OBJECT
0020 
0021 public Q_SLOTS:
0022     void initTestCase();
0023 
0024 private Q_SLOTS:
0025     // openpgp
0026     void testOpenPGPMime();
0027     void testOpenPGPMime_data();
0028 
0029     // the following will do for s-mime as well, as the same sign/enc jobs are used
0030     void testEncryptSameAttachments();
0031     void testEncryptSameAttachments_data();
0032     void testSignEncryptLateAttachments();
0033     void testSignEncryptLateAttachments_data();
0034 
0035     void testEditEncryptAttachments();
0036     void testEditEncryptAttachments_data();
0037 
0038     void testEditEncryptAndLateAttachments();
0039     void testEditEncryptAndLateAttachments_data();
0040 
0041     // test protected headers
0042     void testProtectedHeaders();
0043     void testProtectedHeaders_data();
0044 
0045     // secondary recipients
0046     void testBCCEncrypt();
0047     void testBCCEncrypt_data();
0048 
0049     // inline pgp
0050     void testOpenPGPInline_data();
0051     void testOpenPGPInline();
0052 
0053     // s-mime
0054     void testSMIME_data();
0055     void testSMIME();
0056     void testSMIMEOpaque_data();
0057     void testSMIMEOpaque();
0058 
0059     // contentTransferEncoding
0060     void testCTEquPr_data();
0061     void testCTEquPr();
0062     void testCTEbase64_data();
0063     void testCTEbase64();
0064 
0065     void testSetGnupgHome_data();
0066     void testSetGnupgHome();
0067 
0068     void testAutocryptHeaders_data();
0069     void testAutocryptHeaders();
0070 
0071     void testAutocryptGossip_data();
0072     void testAutocryptGossip();
0073 
0074     // TODO test the code for autodetecting the charset of a text attachment.
0075 private:
0076     void fillComposerData(MessageComposer::Composer *composer, const QString &data);
0077     void fillComposerCryptoData(MessageComposer::Composer *composer);
0078 
0079     // convenience, shared code
0080     void runSMIMETest(bool sign, bool enc, bool opaque);
0081 };