diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-06-24 09:52:41 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-06-24 09:52:41 (GMT) |
commit | cf2f72f4f61f3a9e0e7573379c33bb341eeba7be (patch) | |
tree | 06fbd459f62f87344e7db973a0a9f3050cece825 /tests/auto/qnetworkproxyfactory | |
parent | 164728f711136356a6c3482f762321b01c9d82dd (diff) | |
parent | 705b0f958a6071341b10cbd51917e1378356491b (diff) | |
download | Qt-cf2f72f4f61f3a9e0e7573379c33bb341eeba7be.zip Qt-cf2f72f4f61f3a9e0e7573379c33bb341eeba7be.tar.gz Qt-cf2f72f4f61f3a9e0e7573379c33bb341eeba7be.tar.bz2 |
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts:
src/gui/image/qpixmap_raster_symbian.cpp
src/gui/image/qpixmapdatafactory.cpp
src/gui/painting/qgraphicssystem.cpp
src/gui/styles/qs60style.cpp
src/network/bearer/qnetworkconfigmanager_p.h
src/s60installs/bwins/QtGuiu.def
src/s60installs/bwins/QtOpenGLu.def
src/s60installs/bwins/QtOpenVGu.def
src/s60installs/eabi/QtGuiu.def
src/s60installs/eabi/QtOpenVGu.def
tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
Diffstat (limited to 'tests/auto/qnetworkproxyfactory')
-rw-r--r-- | tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
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" |