summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2020-04-03 10:52:38 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2020-04-03 16:44:55 +0200
commit5ca2e1af8a93bca465c1ed4ed495f62756946bf9 (patch)
treef8ec62671d7d366de9e1c39aa6353aa24faf8843 /tests
parented5bd3c5638b237846234028381cab5d67669786 (diff)
Fix flaky tst_QWebEngineProfile::clearDataFromCache
Fixes: QTBUG-82953 Change-Id: I7dfa916ea0ada00ce84a1e9e49de9eea1800a108 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
index 6b32bb826..6350c8510 100644
--- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
+++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
@@ -237,6 +237,7 @@ static bool loadSync(QWebEngineView *view, const QUrl &url, bool ok = true)
void tst_QWebEngineProfile::clearDataFromCache()
{
TestServer server;
+ QSignalSpy serverSpy(&server, &HttpServer::newRequest);
QVERIFY(server.start());
AutoDir cacheDir("./tst_QWebEngineProfile_clearDataFromCache");
@@ -247,6 +248,8 @@ void tst_QWebEngineProfile::clearDataFromCache()
QWebEnginePage page(&profile);
QVERIFY(loadSync(&page, server.url("/hedgehog.html")));
+ // Wait for GET /favicon.ico
+ QTRY_COMPARE(serverSpy.size(), 3);
QVERIFY(cacheDir.exists("Cache"));
qint64 sizeBeforeClear = totalSize(cacheDir);