diff options
Diffstat (limited to 'tests/auto/quick/qmltests/data')
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_favicon.qml | 33 | ||||
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_notification.qml | 8 |
2 files changed, 40 insertions, 1 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_favicon.qml b/tests/auto/quick/qmltests/data/tst_favicon.qml index 563a87c83..50a412384 100644 --- a/tests/auto/quick/qmltests/data/tst_favicon.qml +++ b/tests/auto/quick/qmltests/data/tst_favicon.qml @@ -375,5 +375,38 @@ TestWebEngineView { faviconImage.destroy() } + + function test_touchIconWithSameURL() + { + WebEngine.settings.touchIconsEnabled = false; + + var icon = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="; + + webEngineView.loadHtml( + "<html>" + + "<link rel='icon' type='image/png' href='" + icon + "'/>" + + "<link rel='apple-touch-icon' type='image/png' href='" + icon + "'/>" + + "</html>" + ); + verify(webEngineView.waitForLoadSucceeded()); + + // The default favicon has to be loaded even if its URL is also set as a touch icon while touch icons are disabled. + tryCompare(iconChangedSpy, "count", 1); + compare(webEngineView.icon.toString().replace(/^image:\/\/favicon\//, ''), icon); + + iconChangedSpy.clear(); + + webEngineView.loadHtml( + "<html>" + + "<link rel='apple-touch-icon' type='image/png' href='" + icon + "'/>" + + "</html>" + ); + verify(webEngineView.waitForLoadSucceeded()); + + // This page only has a touch icon. With disabled touch icons we don't expect any icon to be shown even if the same icon + // was loaded previously. + tryCompare(iconChangedSpy, "count", 1); + verify(!webEngineView.icon.toString().replace(/^image:\/\/favicon\//, '')); + } } } diff --git a/tests/auto/quick/qmltests/data/tst_notification.qml b/tests/auto/quick/qmltests/data/tst_notification.qml index 609a04f61..af4aebafc 100644 --- a/tests/auto/quick/qmltests/data/tst_notification.qml +++ b/tests/auto/quick/qmltests/data/tst_notification.qml @@ -37,6 +37,7 @@ TestWebEngineView { property bool permissionRequested: false property bool grantPermission: false + property url securityOrigin: '' signal consoleMessage(string message) @@ -48,7 +49,8 @@ TestWebEngineView { onFeaturePermissionRequested: { if (feature === WebEngineView.Notifications) { - permissionRequested = true + view.permissionRequested = true + view.securityOrigin = securityOrigin view.grantFeaturePermission(securityOrigin, feature, grantPermission) } } @@ -111,6 +113,10 @@ TestWebEngineView { tryVerify(function () { return notification !== null }) compare(notification.title, title) compare(notification.message, message) + compare(notification.direction, Qt.RightToLeft) + compare(notification.origin, securityOrigin) + compare(notification.tag, 'tst') + compare(notification.language, 'de') } } } |