summaryrefslogtreecommitdiffstats
path: root/tests/auto/installer/cliinterface/tst_cliinterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/installer/cliinterface/tst_cliinterface.cpp')
-rw-r--r--tests/auto/installer/cliinterface/tst_cliinterface.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/installer/cliinterface/tst_cliinterface.cpp b/tests/auto/installer/cliinterface/tst_cliinterface.cpp
index 6040927ea..ebf63ff9d 100644
--- a/tests/auto/installer/cliinterface/tst_cliinterface.cpp
+++ b/tests/auto/installer/cliinterface/tst_cliinterface.cpp
@@ -351,6 +351,31 @@ private slots:
<< "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"
<< "installcontentB.txt" << "installcontentD.txt");
}
+ void testFileQuery()
+ {
+ PackageManagerCore *core = PackageManager::getPackageManagerWithInit(m_installDir,
+ ":///data/filequeryrepository");
+ core->setCommandLineInstance(true);
+ core->setFileDialogAutomaticAnswer("ValidDirectory", m_installDir);
+
+ QString testFile = qApp->applicationDirPath() + QDir::toNativeSeparators("/test");
+ QFile file(testFile);
+ QVERIFY(file.open(QIODevice::WriteOnly));
+ core->setFileDialogAutomaticAnswer("ValidFile", testFile);
+
+ //File dialog launched without ID
+ core->setFileDialogAutomaticAnswer("GetExistingDirectory", m_installDir);
+ core->setFileDialogAutomaticAnswer("GetExistingFile", testFile);
+
+ core->installDefaultComponentsSilently();
+
+ QVERIFY(core->containsFileDialogAutomaticAnswer("ValidFile"));
+ core->removeFileDialogAutomaticAnswer("ValidFile");
+ QVERIFY(!core->containsFileDialogAutomaticAnswer("ValidFile"));
+
+ QVERIFY(file.remove());
+ core->deleteLater();
+ }
void init()
{