Skip to content
Permalink
Browse files

Test ssl errors in background thread

  • Loading branch information
nyalldawson committed Jan 28, 2019
1 parent c707df7 commit b23f08f2706a41652ac3bc69fac60868b02ae5d8
Showing with 16 additions and 2 deletions.
  1. +16 −2 tests/src/core/testqgsnetworkaccessmanager.cpp
@@ -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()

0 comments on commit b23f08f

Please sign in to comment.
You can’t perform that action at this time.