summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-05-13 00:51:13 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-05-14 03:03:46 (GMT)
commite75161c4d54406d137f34b9f54fed853c16a6269 (patch)
tree3c58a9076cbb898413e84258d2d2e5caf58249fa
parente6efa3ea81dff9eb0ade1c2ba868c272ccfcc958 (diff)
downloadQt-e75161c4d54406d137f34b9f54fed853c16a6269.zip
Qt-e75161c4d54406d137f34b9f54fed853c16a6269.tar.gz
Qt-e75161c4d54406d137f34b9f54fed853c16a6269.tar.bz2
Cherry pick fix for MOBILITY-828 from Qt Mobility.
Change 29776be110cdc121eb5a22446be6adae8ff6f4d8 from Qt Mobility.
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.cpp4
-rw-r--r--tests/auto/qnetworksession/test/tst_qnetworksession.cpp30
2 files changed, 28 insertions, 6 deletions
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index 04853c4..f09c73a 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -53,7 +53,7 @@
QT_BEGIN_NAMESPACE
QNetworkSessionPrivateImpl::QNetworkSessionPrivateImpl(SymbianEngine *engine)
- : CActive(CActive::EPriorityStandard), engine(engine),
+ : CActive(CActive::EPriorityUserInput), engine(engine),
ipConnectionNotifier(0), iHandleStateNotificationsFromManager(false),
iFirstSync(true), iStoppedByUser(false), iClosedByUser(false), iDeprecatedConnectionId(0),
iError(QNetworkSession::UnknownSessionError), iALREnabled(0), iConnectInBackground(false)
@@ -1383,7 +1383,7 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne
}
ConnectionProgressNotifier::ConnectionProgressNotifier(QNetworkSessionPrivateImpl& owner, RConnection& connection)
- : CActive(CActive::EPriorityStandard), iOwner(owner), iConnection(connection)
+ : CActive(CActive::EPriorityUserInput), iOwner(owner), iConnection(connection)
{
CActiveScheduler::Add(this);
}
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());