summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2020-01-29 14:59:19 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-30 15:27:53 +0100
commitcec9604fbf0ac13cca56ae55dc3213f8eba78a65 (patch)
tree56dd154460bb69c862d2833f97dfbc8169bd9289 /tests
parent95ec7e63ceb051a861a08a0885fe26a3c42de424 (diff)
Add clear method to QQuickWebEngineHistory
Fixes: QTBUG-71619 Change-Id: I35c5ecbbe78da3114d30945f8ce030937e17d98e Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/publicapi/tst_publicapi.cpp1
-rw-r--r--tests/auto/quick/qmltests/data/tst_navigationHistory.qml7
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index 321972057..3c97f2410 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -300,6 +300,7 @@ static const QStringList expectedAPI = QStringList()
<< "QQuickWebEngineFullScreenRequest.reject() --> void"
<< "QQuickWebEngineFullScreenRequest.toggleOn --> bool"
<< "QQuickWebEngineHistory.backItems --> QQuickWebEngineHistoryListModel*"
+ << "QQuickWebEngineHistory.clear() --> void"
<< "QQuickWebEngineHistory.forwardItems --> QQuickWebEngineHistoryListModel*"
<< "QQuickWebEngineHistory.items --> QQuickWebEngineHistoryListModel*"
<< "QQuickWebEngineJavaScriptDialogRequest.DialogTypeAlert --> DialogType"
diff --git a/tests/auto/quick/qmltests/data/tst_navigationHistory.qml b/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
index 77664e645..6ed232589 100644
--- a/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
+++ b/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
@@ -134,6 +134,13 @@ TestWebEngineView {
compare(forwardItemsList.count, 1)
compare(backItemsList.currentItem.text, Qt.resolvedUrl("test1.html"))
compare(forwardItemsList.currentItem.text, Qt.resolvedUrl("javascript.html"))
+
+ webEngineView.navigationHistory.clear()
+ compare(webEngineView.url, Qt.resolvedUrl("test2.html"))
+ compare(webEngineView.canGoBack, false)
+ compare(webEngineView.canGoForward, false)
+ compare(backItemsList.count, 0)
+ compare(forwardItemsList.count, 0)
}
}
}