diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-18 10:59:16 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-03-19 16:49:30 +0000 |
commit | cbeef3ee920576d668664ca2e0b8a55ae307959a (patch) | |
tree | 1e2ca6e2a87ce87afc7500d261df01ee8cd1ef7c /tests | |
parent | eedee8d37bb49239de54011241eaedded5a4c0ce (diff) |
Do not report client redirects as link-clicked
Fixes false navigation type on http-equiv refresh, and javascript
redirects.
Task-number: QTBUG-74490
Change-Id: Ie6fa5c94ae9642a7e9c689198a4977747f4101ce
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'tests')
3 files changed, 16 insertions, 1 deletions
diff --git a/tests/auto/widgets/qwebenginepage/resources/reload.html b/tests/auto/widgets/qwebenginepage/resources/reload.html new file mode 100644 index 000000000..d9c33dfcd --- /dev/null +++ b/tests/auto/widgets/qwebenginepage/resources/reload.html @@ -0,0 +1,8 @@ +<html> +<head> +<meta http-equiv="refresh" content="2"> +</head> +<body> +This is test content +</body> +</html> diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index fdff57254..8c3b4002c 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -600,11 +600,17 @@ void tst_QWebEnginePage::acceptNavigationRequestNavigationType() QTRY_COMPARE(loadSpy.count(), 4); QTRY_COMPARE(page.navigations.count(), 4); + page.load(QUrl("qrc:///resources/reload.html")); + QTRY_COMPARE(loadSpy.count(), 6); + QTRY_COMPARE(page.navigations.count(), 6); + QList<QWebEnginePage::NavigationType> expectedList; expectedList << QWebEnginePage::NavigationTypeTyped << QWebEnginePage::NavigationTypeTyped << QWebEnginePage::NavigationTypeBackForward - << QWebEnginePage::NavigationTypeReload; + << QWebEnginePage::NavigationTypeReload + << QWebEnginePage::NavigationTypeTyped + << QWebEnginePage::NavigationTypeOther; QVERIFY(expectedList.count() == page.navigations.count()); for (int i = 0; i < expectedList.count(); ++i) { QCOMPARE(page.navigations[i].type, expectedList[i]); diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc index 3bb88cbe1..f2bf8c6ff 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.qrc @@ -14,6 +14,7 @@ <file>resources/user.css</file> <file>resources/image.png</file> <file>resources/pasteimage.html</file> + <file>resources/reload.html</file> <file>resources/style.css</file> <file>resources/test1.html</file> <file>resources/test2.html</file> |