diff options
author | Katja Marttila <katja.marttila@qt.io> | 2020-12-28 14:02:26 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2020-12-30 09:10:29 +0000 |
commit | c9eb521f4520d5624ad83ed3a54705169049ad1c (patch) | |
tree | d0a6add4976ad5c0db68f491390c88de647d807c /tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp | |
parent | ca664d6e9f7b53c5b61237da2fceb8248124ad40 (diff) |
Allow disabling undo in RegisterFileType operation during uninstall
Task-number: QTIFW-2089
Change-Id: I8cccd471718eaaa6dc167a852b8854dc424f994e
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp')
-rw-r--r-- | tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp b/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp index 4d14a2753..5a4377d7b 100644 --- a/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp +++ b/tests/auto/installer/registerfiletypeoperation/tst_registerfiletypeoperation.cpp @@ -66,6 +66,14 @@ private: QCOMPARE(m_settings->value(m_shellAppkey).toString(), QString()); } + void clearSettings() + { + m_settings->setValue(m_defaultKey, QString()); + m_settings->setValue(m_openWithProgIdkey, QString()); + m_settings->setValue(m_shellKey, QString()); + m_settings->setValue(m_shellAppkey, QString()); + } + private slots: void initTestCase() { @@ -126,6 +134,22 @@ private slots: verifySettingsCleaned(); } + void testRegisterFileTypeNoUndo() + { + RegisterFileTypeOperation op(&m_core); + op.setArguments(QStringList() << m_fileType << m_command << "test filetype" << + "text/plain" << 0 << "ProgId="+m_progId << "UNDOOPERATION" << ""); + QVERIFY(op.testOperation()); + QVERIFY(op.performOperation()); + + verifySettings(); + QVERIFY(op.undoOperation()); + verifySettings(); + + //Clear so it does not pollute settings + clearSettings(); + } + void testPerformingFromCLI() { QString installDir = QInstaller::generateTemporaryFileName(); |