summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/quick/qmltests/data/tst_favicon.qml9
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp8
2 files changed, 16 insertions, 1 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_favicon.qml b/tests/auto/quick/qmltests/data/tst_favicon.qml
index d12fbab55..8448960dd 100644
--- a/tests/auto/quick/qmltests/data/tst_favicon.qml
+++ b/tests/auto/quick/qmltests/data/tst_favicon.qml
@@ -200,8 +200,15 @@ TestWebEngineView {
iconChangedSpy.wait()
verify(iconChangedSpy.count >= 1)
-
iconUrl = webEngineView.icon
+
+ // If the icon URL is empty we have to wait for
+ // the second iconChanged signal that propagates the expected URL
+ if (iconUrl == Qt.resolvedUrl("")) {
+ tryCompare(iconChangedSpy, "count", 2)
+ iconUrl = webEngineView.icon
+ }
+
compare(iconUrl, Qt.resolvedUrl("icons/qt144.png"))
compare(favicon.width, 144)
compare(favicon.height, 144)
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp b/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp
index 89a33134f..a0f864a6f 100644
--- a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp
+++ b/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp
@@ -244,6 +244,14 @@ void tst_QWebEngineFaviconManager::bestFavicon()
QTRY_VERIFY(iconUrlChangedSpy.count() >= 1);
iconUrl = iconUrlChangedSpy.last().at(0).toString();
+
+ // If the icon URL is empty we have to wait for
+ // the second iconChanged signal that propagates the expected URL
+ if (iconUrl.isEmpty()) {
+ QTRY_COMPARE(iconUrlChangedSpy.count(), 2);
+ iconUrl = iconUrlChangedSpy.last().at(0).toString();
+ }
+
QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qt144.png")));
}