diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-05-13 00:51:13 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-05-14 03:03:46 (GMT) |
commit | e75161c4d54406d137f34b9f54fed853c16a6269 (patch) | |
tree | 3c58a9076cbb898413e84258d2d2e5caf58249fa /tests/auto/qnetworksession/test | |
parent | e6efa3ea81dff9eb0ade1c2ba868c272ccfcc958 (diff) | |
download | Qt-e75161c4d54406d137f34b9f54fed853c16a6269.zip Qt-e75161c4d54406d137f34b9f54fed853c16a6269.tar.gz Qt-e75161c4d54406d137f34b9f54fed853c16a6269.tar.bz2 |
Cherry pick fix for MOBILITY-828 from Qt Mobility.
Change 29776be110cdc121eb5a22446be6adae8ff6f4d8 from Qt Mobility.
Diffstat (limited to 'tests/auto/qnetworksession/test')
-rw-r--r-- | tests/auto/qnetworksession/test/tst_qnetworksession.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp index 8ab9da2..934a50e 100644 --- a/tests/auto/qnetworksession/test/tst_qnetworksession.cpp +++ b/tests/auto/qnetworksession/test/tst_qnetworksession.cpp @@ -263,10 +263,6 @@ void tst_QNetworkSession::robustnessBombing() testSession.accept(); testSession.ignore(); testSession.reject(); - quint64 temp; - temp = testSession.bytesWritten(); - temp = testSession.bytesReceived(); - temp = testSession.activeTime(); } @@ -704,7 +700,20 @@ void tst_QNetworkSession::userChoiceSession() session.open(); +#if defined(Q_OS_SYMBIAN) + // Opening & closing multiple connections in a row sometimes + // results hanging of connection opening on Symbian devices + // => If first open fails, wait a moment and try again. + if (!session.waitForOpened()) { + qDebug("**** Session open Timeout - Wait 5 seconds and try once again ****"); + session.close(); + QTest::qWait(5000); // Wait a while before trying to open session again + session.open(); + session.waitForOpened(); + } +#else session.waitForOpened(); +#endif if (session.isOpen()) QVERIFY(!sessionOpenedSpy.isEmpty() || !errorSpy.isEmpty()); @@ -843,7 +852,20 @@ void tst_QNetworkSession::sessionOpenCloseStop() session.open(); +#if defined(Q_OS_SYMBIAN) + // Opening & closing multiple connections in a row sometimes + // results hanging of connection opening on Symbian devices + // => If first open fails, wait a moment and try again. + if (!session.waitForOpened()) { + qDebug("**** Session open Timeout - Wait 5 seconds and try once again ****"); + session.close(); + QTest::qWait(5000); // Wait a while before trying to open session again + session.open(); + session.waitForOpened(); + } +#else session.waitForOpened(); +#endif if (session.isOpen()) QVERIFY(!sessionOpenedSpy.isEmpty() || !errorSpy.isEmpty()); |