diff options
author | Martin Negyokru <negyokru@inf.u-szeged.hu> | 2023-08-16 15:43:53 +0200 |
---|---|---|
committer | Martin Negyokru <negyokru@inf.u-szeged.hu> | 2023-08-17 12:51:47 +0000 |
commit | 964df29ae7dfff2f397fd600c1a62059623a5ff0 (patch) | |
tree | e7671274e2c04b16311cc878b3f68e7e70733269 /tests | |
parent | 760540d18fc4df52e328430fb7b14e67d386a2d2 (diff) |
Second attemp to fix acceptNavigationRequestNavigationType test
Naviagte away from reload.html as it may reload
multiple times.
Task-number: QTBUG-105342
Task-number: QTBUG-116165
Change-Id: I5dc6b7eeb9827a13752f476f2e3b0c415cedbb43
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/qwebenginepage/resources/reload.html | 2 | ||||
-rw-r--r-- | tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/widgets/qwebenginepage/resources/reload.html b/tests/auto/widgets/qwebenginepage/resources/reload.html index 6fc570cae..062d06807 100644 --- a/tests/auto/widgets/qwebenginepage/resources/reload.html +++ b/tests/auto/widgets/qwebenginepage/resources/reload.html @@ -1,6 +1,6 @@ <html> <head> -<meta http-equiv="refresh" content="2;url="> +<meta http-equiv="refresh" content="2;url=qrc:///resources/content.html"> </head> <body> This is test content diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index c9bcb11bd..e6e0d2973 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -680,19 +680,19 @@ void tst_QWebEnginePage::acceptNavigationRequestNavigationType() QTRY_COMPARE(loadSpy.size(), 4); QTRY_COMPARE(page.navigations.size(), 4); - page.load(QUrl("qrc:///resources/reload.html")); - QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 6, 20000); - QTRY_COMPARE(page.navigations.size(), 6); - QList<QWebEngineNavigationRequest::NavigationType> expectedList; expectedList << QWebEngineNavigationRequest::TypedNavigation << QWebEngineNavigationRequest::TypedNavigation << QWebEngineNavigationRequest::BackForwardNavigation - << QWebEngineNavigationRequest::ReloadNavigation - << QWebEngineNavigationRequest::TypedNavigation - << QWebEngineNavigationRequest::RedirectNavigation; + << QWebEngineNavigationRequest::ReloadNavigation; // client side redirect + page.load(QUrl("qrc:///resources/reload.html")); + QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 6, 20000); + QTRY_COMPARE(page.navigations.size(), 6); + expectedList += { QWebEngineNavigationRequest::TypedNavigation, QWebEngineNavigationRequest::RedirectNavigation }; + + page.load(QUrl("qrc:///resources/redirect.html")); QTRY_COMPARE_WITH_TIMEOUT(loadSpy.size(), 7, 20000); QTRY_COMPARE(page.navigations.size(), 8); |