diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-24 21:50:54 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-06-24 21:50:54 (GMT) |
commit | 36a464681a349a0915f821786b4617695c1d02d4 (patch) | |
tree | 80d85a8d12df15e2dc727a4d584d400b038c6090 /tests | |
parent | 2463367391803130e9f320cbd129aece5b1b708e (diff) | |
parent | cf2f72f4f61f3a9e0e7573379c33bb341eeba7be (diff) | |
download | Qt-36a464681a349a0915f821786b4617695c1d02d4.zip Qt-36a464681a349a0915f821786b4617695c1d02d4.tar.gz Qt-36a464681a349a0915f821786b4617695c1d02d4.tar.bz2 |
Merge branch 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (28 commits)
Use numeric virtual keyboard for all number entry modes.
QTBUG-17776, reporting terminated threads as not running on Symbian
Splitview - Auto-translation rules changed
Support clipboard function on Symbian
Added qmlshadersplugin to Symbian qt.iby-file.
Workaround webkit deadlock on macos x
Disable antialiasing for tiled image drawing.
Ensure visibility of input widget in QML app when doing layout switch
Def update for gui, openvg, and opengl.
Revert "Def update."
Fix trailing whitespace
Remove unnecessary resizes during orientation change
Revert "Symbian: Fix QFontInfo::pixelSize()"
Improving warning messages in QVolatileImage.
Proper naming for raster pixmap and paintengine on Symbian.
Def update.
Handle QVolatileImage-backed pixmaps optimally in drawPixmap().
Resizable graphicsview's background is drawn incorrectly in splitview
Add inputcontext reset to orientation switch in Symbian
QS60Style: QGroupBox is drawn as white box in upcoming Symbian release
...
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp | 44 | ||||
-rw-r--r-- | tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp | 29 |
2 files changed, 73 insertions, 0 deletions
diff --git a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp index 57bf583..d29ef77 100644 --- a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp +++ b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp @@ -62,6 +62,7 @@ public slots: void cleanup(); private slots: + void usedInThread(); // this test must be first, or it will falsely pass void allConfigurations(); void defaultConfiguration(); void configurationFromIdentifier(); @@ -329,6 +330,49 @@ void tst_QNetworkConfigurationManager::configurationFromIdentifier() QVERIFY(!invalid.isValid()); } +class QNCMTestThread : public QThread +{ +protected: + virtual void run() + { + QNetworkConfigurationManager manager; + preScanConfigs = manager.allConfigurations(); + QSignalSpy spy(&manager, SIGNAL(updateCompleted())); + manager.updateConfigurations(); //initiate scans + QTRY_VERIFY(spy.count() == 1); //wait for scan to complete + configs = manager.allConfigurations(); + } +public: + QList<QNetworkConfiguration> configs; + QList<QNetworkConfiguration> preScanConfigs; +}; + +// regression test for QTBUG-18795 +void tst_QNetworkConfigurationManager::usedInThread() +{ +#if defined Q_OS_MAC && !defined (QT_NO_COREWLAN) + QSKIP("QTBUG-19070 Mac CoreWlan plugin is broken", SkipAll); +#else + QNCMTestThread thread; + connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + thread.start(); + QTestEventLoop::instance().enterLoop(100); //QTRY_VERIFY could take ~90 seconds to time out in the thread + QVERIFY(!QTestEventLoop::instance().timeout()); + qDebug() << "prescan:" << thread.preScanConfigs.count(); + qDebug() << "postscan:" << thread.configs.count(); + + QNetworkConfigurationManager manager; + QList<QNetworkConfiguration> preScanConfigs = manager.allConfigurations(); + QSignalSpy spy(&manager, SIGNAL(updateCompleted())); + manager.updateConfigurations(); //initiate scans + QTRY_VERIFY(spy.count() == 1); //wait for scan to complete + QList<QNetworkConfiguration> configs = manager.allConfigurations(); + QCOMPARE(thread.configs, configs); + //Don't compare pre scan configs, because these may be cached and therefore give different results + //which makes the test unstable. The post scan results should have all configurations every time + //QCOMPARE(thread.preScanConfigs, preScanConfigs); +#endif +} QTEST_MAIN(tst_QNetworkConfigurationManager) #include "tst_qnetworkconfigurationmanager.moc" diff --git a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp index 45464ca..839612e 100644 --- a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp +++ b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp @@ -41,6 +41,7 @@ #include <QtTest/QTest> +#include <QtTest/QTestEventLoop> #include <qcoreapplication.h> #include <qdebug.h> @@ -52,6 +53,7 @@ #include <QNetworkReply> #include <QNetworkRequest> #include <QList> +#include <QThread> Q_DECLARE_METATYPE(QNetworkConfiguration); Q_DECLARE_METATYPE(QList<QNetworkProxy>); @@ -76,6 +78,7 @@ public: }; private slots: + void systemProxyForQueryCalledFromThread(); void systemProxyForQuery() const; #ifndef QT_NO_BEARERMANAGEMENT void fromConfigurations(); @@ -241,5 +244,31 @@ void tst_QNetworkProxyFactory::inNetworkAccessManager() #endif //QT_NO_BEARERMANAGEMENT +class QSPFQThread : public QThread +{ +protected: + virtual void run() + { + proxies = QNetworkProxyFactory::systemProxyForQuery(query); + } +public: + QNetworkProxyQuery query; + QList<QNetworkProxy> proxies; +}; + +//regression test for QTBUG-18799 +void tst_QNetworkProxyFactory::systemProxyForQueryCalledFromThread() +{ + QUrl url(QLatin1String("http://qt.nokia.com")); + QNetworkProxyQuery query(url); + QSPFQThread thread; + thread.query = query; + connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + thread.start(); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(thread.isFinished()); + QCOMPARE(thread.proxies, QNetworkProxyFactory::systemProxyForQuery(query)); +} + QTEST_MAIN(tst_QNetworkProxyFactory) #include "tst_qnetworkproxyfactory.moc" |