Skip to content

Commit

Permalink
Test ssl errors in background thread
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 28, 2019
1 parent c707df7 commit b23f08f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/src/core/testqgsnetworkaccessmanager.cpp
Expand Up @@ -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()
Expand Down

0 comments on commit b23f08f

Please sign in to comment.