summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2023-07-26 09:37:11 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2023-08-17 20:26:43 +0200
commit37430020d373304f812fa822651cf2a0ccf636d3 (patch)
treea4c6b84fbb12a9c56d0ee9b91ce5192eb7514e56 /tests/auto/widgets
parentb18818d918ed9f2d9775d1786ef641dfa30aadf6 (diff)
Add clearHttpCacheCompleted signal to profile
[ChangeLog][QtWebEngineQuick][WebEngineProfile] Added clearHttpCacheCompleted signal. [ChangeLog][QtWebEngineCore][QWebEngineProfile] Added clearHttpCacheCompleted signal. Fixes: QTBUG-89670 Fixes: QTBUG-111541 Change-Id: If93a99f7171c516ef75a3c8004da9ae621705a1a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
index 471385223..095d4c8f2 100644
--- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
+++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
@@ -190,6 +190,7 @@ void tst_QWebEngineProfile::clearDataFromCache()
AutoDir cacheDir("./tst_QWebEngineProfile_clearDataFromCache");
QWebEngineProfile profile(QStringLiteral("clearDataFromCache"));
+ QSignalSpy cacheSpy(&profile, &QWebEngineProfile::clearHttpCacheCompleted);
profile.setCachePath(cacheDir.path());
profile.setHttpCacheType(QWebEngineProfile::DiskHttpCache);
@@ -201,8 +202,7 @@ void tst_QWebEngineProfile::clearDataFromCache()
QVERIFY(cacheDir.exists("Cache"));
qint64 sizeBeforeClear = totalSize(cacheDir);
profile.clearHttpCache();
- // Wait for cache to be cleared.
- QTest::qWait(1000);
+ QTRY_COMPARE(cacheSpy.size(), 1);
QVERIFY(sizeBeforeClear > totalSize(cacheDir));
(void)server.stop();