summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2014-03-27 17:26:27 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-28 19:45:12 +0100
commit072353fed80645a53b4bb22507dca5b98c023232 (patch)
treea1ff902544c8ff8337929333b1aefee7f5f0a9ac /tests/auto/quick
parent7b64cb4c82067c249274d6b33fb4a20b60d34eac (diff)
Fix QQuickWebEngineForwardHistoryListModel
The index calculation was wrong for the history items in the forward list model: model contained the current item too. Test has been added for check the previous and next element in the back and forward lists. Change-Id: I0e05881f05b67752e47b01236ffb9636d31a7dc2 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r--tests/auto/quick/qmltests/data/tst_navigationHistory.qml14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_navigationHistory.qml b/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
index bac87a861..c86245522 100644
--- a/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
+++ b/tests/auto/quick/qmltests/data/tst_navigationHistory.qml
@@ -53,10 +53,11 @@ TestWebEngineView {
id: backItemsList
anchors.fill: parent
model: webEngineView.experimental.navigationHistory.backItems
+ currentIndex: count - 1
delegate:
Text {
color:"black"
- text: "title : " + title
+ text: url
}
}
@@ -64,10 +65,11 @@ TestWebEngineView {
id: forwardItemsList
anchors.fill: parent
model: webEngineView.experimental.navigationHistory.forwardItems
+ currentIndex: 0
delegate:
Text {
color:"black"
- text: "title : " + title
+ text: url
}
}
@@ -90,6 +92,7 @@ TestWebEngineView {
compare(webEngineView.canGoBack, true)
compare(webEngineView.canGoForward, false)
compare(backItemsList.count, 1)
+ compare(backItemsList.currentItem.text, Qt.resolvedUrl("test1.html"))
webEngineView.experimental.goBackTo(0)
verify(webEngineView.waitForLoadSucceeded())
@@ -98,6 +101,7 @@ TestWebEngineView {
compare(webEngineView.canGoForward, true)
compare(backItemsList.count, 0)
compare(forwardItemsList.count, 1)
+ compare(forwardItemsList.currentItem.text, Qt.resolvedUrl("test2.html"))
webEngineView.goForward()
verify(webEngineView.waitForLoadSucceeded())
@@ -106,6 +110,7 @@ TestWebEngineView {
compare(webEngineView.canGoForward, false)
compare(backItemsList.count, 1)
compare(forwardItemsList.count, 0)
+ compare(backItemsList.currentItem.text, Qt.resolvedUrl("test1.html"))
webEngineView.url = Qt.resolvedUrl("javascript.html")
verify(webEngineView.waitForLoadSucceeded())
@@ -114,6 +119,7 @@ TestWebEngineView {
compare(webEngineView.canGoForward, false)
compare(backItemsList.count, 2)
compare(forwardItemsList.count, 0)
+ compare(backItemsList.currentItem.text, Qt.resolvedUrl("test1.html"))
webEngineView.experimental.goBackTo(1)
verify(webEngineView.waitForLoadSucceeded())
@@ -122,6 +128,7 @@ TestWebEngineView {
compare(webEngineView.canGoForward, true)
compare(backItemsList.count, 0)
compare(forwardItemsList.count, 2)
+ compare(forwardItemsList.currentItem.text, Qt.resolvedUrl("test2.html"))
webEngineView.experimental.goForwardTo(1)
verify(webEngineView.waitForLoadSucceeded())
@@ -130,6 +137,7 @@ TestWebEngineView {
compare(webEngineView.canGoForward, false)
compare(backItemsList.count, 2)
compare(forwardItemsList.count, 0)
+ compare(backItemsList.currentItem.text, Qt.resolvedUrl("test1.html"))
webEngineView.goBack()
verify(webEngineView.waitForLoadSucceeded())
@@ -138,6 +146,8 @@ TestWebEngineView {
compare(webEngineView.canGoForward, true)
compare(backItemsList.count, 1)
compare(forwardItemsList.count, 1)
+ compare(backItemsList.currentItem.text, Qt.resolvedUrl("test1.html"))
+ compare(forwardItemsList.currentItem.text, Qt.resolvedUrl("javascript.html"))
}
}
}