From 682e4795fe7a5ae64268212b23ff96706a0822d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Thu, 4 Jul 2019 14:14:28 +0200 Subject: [PATCH] QNetworkReply: Skip a test when QNetworkStatusMonitor is enabled QNetworkSession has a concept of UsagePolicy which can disable background* transfers to conserve battery or bandwidth. However, it is only possible to change the policy through QNetworkSessionPrivate::setUsagePolicy which currently doesn't have any callers outside of our auto tests. *background = transfers not initiated directly by the user, but needs to be marked as such by the application developer. Change-Id: I92c4abccaca040612b4795abe7c52d68a2d21749 Reviewed-by: Timur Pocheptsov --- tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 1afd8af7b0..6f00780d81 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -8200,6 +8200,9 @@ void tst_QNetworkReply::backgroundRequestInterruption_data() void tst_QNetworkReply::backgroundRequestInterruption() { #ifndef QT_NO_BEARERMANAGEMENT + if (QNetworkStatusMonitor::isEnabled() && QByteArray(QTest::currentDataTag()).startsWith("http")) + QSKIP("This test (currently) doesn't make any sense when QNetworkStatusMonitor is enabled"); + QFETCH(QUrl, url); QFETCH(bool, background); QFETCH(QNetworkReply::NetworkError, error);