QNetworkReply auto test: adapt to new session life time

... supported on the new test server. Once the new server image is in
place, we can only allow for the new life time hint of 300 seconds.

Task-number: QTBUG-33040
Change-Id: Id6ad9983789cc6badf3fc2f6628bf79379988201
Reviewed-by: Richard J. Moore <rich@kde.org>
This commit is contained in:
Peter Hartmann 2013-08-19 11:34:48 +02:00 committed by The Qt Project
parent 6be9cb2068
commit fcd212e7ba

View File

@ -6040,11 +6040,13 @@ void tst_QNetworkReply::sslSessionSharingFromPersistentSession()
QByteArray sslSession = warmupReply->sslConfiguration().session();
QCOMPARE(!sslSession.isEmpty(), sessionPersistenceEnabled);
// test server sends a life time hint of 0, which is not common
// practice; however it is good enough because the default is -1
int expectedSessionTicketLifeTimeHint = sessionPersistenceEnabled ? 0 : -1;
QCOMPARE(warmupReply->sslConfiguration().sessionTicketLifeTimeHint(),
expectedSessionTicketLifeTimeHint);
// test server sends a life time hint of 0 (old server) or 300 (new server),
// without session ticket we get -1
QList<int> expectedSessionTicketLifeTimeHint = sessionPersistenceEnabled
? QList<int>() << 0 << 300 : QList<int>() << -1;
QVERIFY2(expectedSessionTicketLifeTimeHint.contains(
warmupReply->sslConfiguration().sessionTicketLifeTimeHint()),
"server did not send expected session life time hint");
warmupReply->deleteLater();