summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2022-05-31 13:08:05 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-06-07 19:29:26 +0000
commitc5de1b21232c7114b27e42fa8c15cb323d256e47 (patch)
treed495d46c1ac63a8447e290d785ded071c05b0019 /tests/auto/quick
parent10b4b06d28dbeb0de67edcb94eb85df4d70e4f55 (diff)
Do not reset favicon for same document navigations
Fixes: QTBUG-103735 Pick-to: 6.3 6.4 Change-Id: Iee0c09cde16a825097b7c1c014655476989922c0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r--tests/auto/quick/qmltests/data/tst_favicon.qml32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_favicon.qml b/tests/auto/quick/qmltests/data/tst_favicon.qml
index 79c835c70..ce4a2aa3c 100644
--- a/tests/auto/quick/qmltests/data/tst_favicon.qml
+++ b/tests/auto/quick/qmltests/data/tst_favicon.qml
@@ -165,6 +165,38 @@ TestWebEngineView {
compare(iconUrl, Qt.resolvedUrl("icons/qt32.ico"))
}
+ function test_faviconLoadPushState_data() {
+ return [
+ { tag: "OTR", profile: defaultProfile },
+ { tag: "non-OTR", profile: nonOTRProfile },
+ ];
+ }
+
+ function test_faviconLoadPushState(row) {
+ webEngineView.profile = row.profile;
+ compare(iconChangedSpy.count, 0);
+
+ var iconUrl;
+
+ webEngineView.url = Qt.resolvedUrl("favicon.html");
+ verify(webEngineView.waitForLoadSucceeded());
+ tryCompare(iconChangedSpy, "count", 1);
+ iconUrl = removeFaviconProviderPrefix(webEngineView.icon);
+ compare(iconUrl, Qt.resolvedUrl("icons/favicon.png"));
+
+ iconChangedSpy.clear();
+
+ // pushState() is a same document navigation and should not reset or
+ // update favicon.
+ compare(webEngineView.history.items.rowCount(), 1);
+ runJavaScript("history.pushState('', '')");
+ tryVerify(function() { return webEngineView.history.items.rowCount() === 2; });
+
+ // Favicon change is not expected.
+ compare(iconChangedSpy.count, 0);
+ iconUrl = removeFaviconProviderPrefix(webEngineView.icon);
+ compare(iconUrl, Qt.resolvedUrl("icons/favicon.png"));
+ }
function test_noFavicon_data() {
return [