summaryrefslogtreecommitdiffstats
path: root/tests/auto/networkselftest/tst_networkselftest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/networkselftest/tst_networkselftest.cpp')
-rw-r--r--tests/auto/networkselftest/tst_networkselftest.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/auto/networkselftest/tst_networkselftest.cpp b/tests/auto/networkselftest/tst_networkselftest.cpp
index c21fd03..b2ce5ca 100644
--- a/tests/auto/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/networkselftest/tst_networkselftest.cpp
@@ -371,11 +371,18 @@ void tst_NetworkSelfTest::initTestCase()
{
#ifndef QT_NO_BEARERMANAGEMENT
netConfMan = new QNetworkConfigurationManager(this);
+ netConfMan->updateConfigurations();
+ connect(netConfMan, SIGNAL(updateCompleted()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
networkConfiguration = netConfMan->defaultConfiguration();
- networkSession.reset(new QNetworkSession(networkConfiguration));
- if (!networkSession->isOpen()) {
- networkSession->open();
- QVERIFY(networkSession->waitForOpened(30000));
+ if (networkConfiguration.isValid()) {
+ networkSession.reset(new QNetworkSession(networkConfiguration));
+ if (!networkSession->isOpen()) {
+ networkSession->open();
+ QVERIFY(networkSession->waitForOpened(30000));
+ }
+ } else {
+ QVERIFY(!(netConfMan->capabilities() & QNetworkConfigurationManager::NetworkSessionRequired));
}
#endif
}