Test ssl errors in background thread

This commit is contained in:
Nyall Dawson 2019-01-28 09:30:29 +10:00
parent c707df7d15
commit b23f08f270

View File

@ -353,14 +353,28 @@ void TestQgsNetworkAccessManager::fetchBadSsl()
} );
QgsNetworkAccessManager::instance()->get( QNetworkRequest( u ) );
while ( !loaded && !gotSslError )
while ( !loaded && !gotSslError && !gotRequestAboutToBeCreatedSignal )
{
qApp->processEvents();
}
QVERIFY( gotRequestAboutToBeCreatedSignal );
// we don't test for background thread ssl error yet -- that signal isn't thread safe
gotRequestAboutToBeCreatedSignal = false;
loaded = false;
gotSslError = false;
BackgroundRequest *thread = new BackgroundRequest( QNetworkRequest( u ) );
thread->start();
while ( !loaded && !gotSslError && !gotRequestAboutToBeCreatedSignal )
{
qApp->processEvents();
}
QVERIFY( gotRequestAboutToBeCreatedSignal );
thread->exit();
thread->wait();
thread->deleteLater();
}
void TestQgsNetworkAccessManager::fetchTimeout()