diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2016-03-19 11:41:15 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-03-19 22:56:15 +0000 |
commit | 4d6b2dc88bda15ade9d04e54d80b7e4693d59832 (patch) | |
tree | 693fbd8a58df50358770cec788240df31afd0cc6 /tests/auto/widgets | |
parent | df222f8ccb2151e519b92d3d2046ee74f221902e (diff) |
Fix bestFavicon test
Workaround the case when the page load finishes earlier than the icon
url is updated and the test should wait more for the actual icon url.
Change-Id: I9553bf444843e9932842ed5e61dfc87a8e970ad3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r-- | tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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"))); } |