From f8151d8b184f14d410485a1556cbad01f9f90f65 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 16 Jul 2021 12:39:12 +0200 Subject: Improve acceptNavigationRequestNavigationType feedback Tell us how the types changed before erroring out. Change-Id: Ib606bc3def58959a91f6d4ee97c797fced389131 Reviewed-by: Michal Klocek (cherry picked from commit a4cf124c839c271b3132d91fc5b580e09a1ae95f) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index db467562a..7e848dbe4 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -635,17 +635,17 @@ void tst_QWebEnginePage::acceptNavigationRequestNavigationType() QVERIFY(server.start()); page.load(QUrl(server.url("/redirect1.html"))); QTRY_COMPARE_WITH_TIMEOUT(loadSpy.count(), 8, 20000); - QTRY_COMPARE(page.navigations.count(), 11); expectedList += { QWebEngineNavigationRequest::TypedNavigation, QWebEngineNavigationRequest::RedirectNavigation, QWebEngineNavigationRequest::RedirectNavigation }; - QVERIFY(expectedList.count() == page.navigations.count()); for (int i = 0; i < expectedList.count(); ++i) { + QTRY_VERIFY(i < page.navigations.count()); QCOMPARE(page.navigations[i].type, expectedList[i]); } + QVERIFY(expectedList.count() == page.navigations.count()); } // Relative url without base url. -- cgit v1.2.3