diff options
Diffstat (limited to 'tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp')
-rw-r--r-- | tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp | 56 |
1 files changed, 23 insertions, 33 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 5301dababc..67e46ad1b3 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -96,7 +96,6 @@ public: tst_QApplication(); private slots: - void initTestCase(); void cleanup(); void sendEventsOnProcessEvents(); // this must be the first test void staticSetup(); @@ -187,13 +186,6 @@ public: } }; -void tst_QApplication::initTestCase() -{ - // chdir to our testdata path and execute helper apps relative to that. - const QString testdataDir = QFileInfo(QFINDTESTDATA("desktopsettingsaware")).absolutePath(); - QVERIFY2(QDir::setCurrent(testdataDir), qPrintable("Could not chdir to " + testdataDir)); -} - void tst_QApplication::sendEventsOnProcessEvents() { int argc = 0; @@ -277,6 +269,9 @@ public: void tst_QApplication::alert() { +#ifdef Q_OS_WINRT + QSKIP("WinRT does not support more than 1 native widget at the same time"); +#endif int argc = 0; QApplication app(argc, 0); app.alert(0, 0); @@ -820,6 +815,9 @@ public: void tst_QApplication::closeAllWindows() { +#ifdef Q_OS_WINRT + QSKIP("PromptOnCloseWidget does not work on WinRT - QTBUG-68297"); +#endif int argc = 0; QApplication app(argc, 0); @@ -888,7 +886,11 @@ bool isPathListIncluded(const QStringList &l, const QStringList &r) #define QT_TST_QAPP_DEBUG void tst_QApplication::libraryPaths() { +#ifndef BUILTIN_TESTDATA const QString testDir = QFileInfo(QFINDTESTDATA("test/test.pro")).absolutePath(); +#else + const QString testDir = QFileInfo(QFINDTESTDATA("test.pro")).absolutePath(); +#endif QVERIFY(!testDir.isEmpty()); { QApplication::setLibraryPaths(QStringList() << testDir); @@ -921,6 +923,9 @@ void tst_QApplication::libraryPaths() QStringList expected = QSet<QString>::fromList((QStringList() << installPathPlugins << appDirPath)).toList(); expected.sort(); +#ifdef Q_OS_WINRT + QEXPECT_FAIL("", "On WinRT PluginsPath is outside of sandbox. QTBUG-68297", Abort); +#endif QVERIFY2(isPathListIncluded(actual, expected), qPrintable("actual:\n - " + actual.join("\n - ") + "\nexpected:\n - " + expected.join("\n - "))); @@ -1040,6 +1045,9 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2() << QDir(app.applicationDirPath()).canonicalPath() << QDir(QDir::fromNativeSeparators(QString::fromLatin1(validPath))).canonicalPath(); +#ifdef Q_OS_WINRT + QEXPECT_FAIL("", "On WinRT PluginsPath is outside of sandbox. QTBUG-68297", Abort); +#endif QVERIFY2(isPathListIncluded(app.libraryPaths(), expected), qPrintable("actual:\n - " + app.libraryPaths().join("\n - ") + "\nexpected:\n - " + expected.join("\n - "))); @@ -1434,20 +1442,10 @@ void tst_QApplication::testDeleteLaterProcessEvents() void tst_QApplication::desktopSettingsAware() { #if QT_CONFIG(process) - QString path; - { - // We need an application object for QFINDTESTDATA to work - // properly in all cases. - int argc = 0; - QCoreApplication app(argc, 0); - path = QFINDTESTDATA("desktopsettingsaware/"); - } - QVERIFY2(!path.isEmpty(), "Cannot locate desktopsettingsaware helper application"); - path += "desktopsettingsaware"; QProcess testProcess; - testProcess.start(path); + testProcess.start("desktopsettingsaware_helper"); QVERIFY2(testProcess.waitForStarted(), - qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString()))); + qPrintable(QString::fromLatin1("Cannot start 'desktopsettingsaware_helper': %1").arg(testProcess.errorString()))); QVERIFY(testProcess.waitForFinished(10000)); QCOMPARE(int(testProcess.state()), int(QProcess::NotRunning)); QVERIFY(int(testProcess.error()) != int(QProcess::Crashed)); @@ -1744,6 +1742,9 @@ void tst_QApplication::focusMouseClick() QSpontaneKeyEvent::setSpontaneous(&ev); QVERIFY(ev.spontaneous()); qApp->notify(&w2, &ev); +#ifdef Q_OS_WINRT + QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort); +#endif QTRY_COMPARE(QApplication::focusWidget(), &w2); // now back to tab focus and click again (it already had focus) -> focus should stay @@ -2112,23 +2113,12 @@ void tst_QApplication::touchEventPropagation() void tst_QApplication::qtbug_12673() { - QString path; - { - // We need an application object for QFINDTESTDATA to work - // properly in all cases. - int argc = 0; - QCoreApplication app(argc, 0); - path = QFINDTESTDATA("modal/"); - } - QVERIFY2(!path.isEmpty(), "Cannot locate modal helper application"); - path += "modal"; - #if QT_CONFIG(process) QProcess testProcess; QStringList arguments; - testProcess.start(path, arguments); + testProcess.start("modal_helper", arguments); QVERIFY2(testProcess.waitForStarted(), - qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString()))); + qPrintable(QString::fromLatin1("Cannot start 'modal_helper': %1").arg(testProcess.errorString()))); QVERIFY(testProcess.waitForFinished(20000)); QCOMPARE(testProcess.exitStatus(), QProcess::NormalExit); #else |