diff options
Diffstat (limited to 'tests')
4 files changed, 14 insertions, 7 deletions
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index b89652625..0012249c8 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -99,6 +99,7 @@ static const QStringList hardcodedTypes = QStringList() << "QQuickWebEngineErrorPage*" << "const QQuickWebEngineContextMenuData*" << "QWebEngineCookieStore*" + << "Qt::LayoutDirection" ; static const QStringList expectedAPI = QStringList() @@ -760,10 +761,7 @@ static const QStringList expectedAPI = QStringList() << "QWebEngineNotification.message --> QString" << "QWebEngineNotification.tag --> QString" << "QWebEngineNotification.language --> QString" - << "QWebEngineNotification.direction --> Direction" - << "QWebEngineNotification.LeftToRight --> Direction" - << "QWebEngineNotification.RightToLeft --> Direction" - << "QWebEngineNotification.DirectionAuto --> Direction" + << "QWebEngineNotification.direction --> Qt::LayoutDirection" << "QWebEngineNotification.show() --> void" << "QWebEngineNotification.click() --> void" << "QWebEngineNotification.close() --> void" 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') } } } diff --git a/tests/auto/shared/data/notification.html b/tests/auto/shared/data/notification.html index cadcbd942..1d1e9c411 100644 --- a/tests/auto/shared/data/notification.html +++ b/tests/auto/shared/data/notification.html @@ -8,7 +8,7 @@ function getPermission() { return document.Notification } function sendNotification(title, body) { - let notification = new Notification(title, { body: body }) + let notification = new Notification(title, { body: body, dir: 'rtl', lang: 'de', tag: 'tst' }) notification.onclick = function() { console.info('onclick') } notification.onclose = function() { console.info('onclose') } notification.onerror = function(error) { console.info('onerror: ' + error) } diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp index 2cdefe27d..916db3d1e 100644 --- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp +++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp @@ -3329,10 +3329,13 @@ void tst_QWebEnginePage::sendNotification() auto notification = presenter.waitForResult(); QVERIFY(presenter.wasCalled()); - QVERIFY(!notification.isNull()); + QVERIFY(notification.isValid()); QCOMPARE(notification.title(), title); QCOMPARE(notification.message(), message); QCOMPARE(notification.origin(), origin); + QCOMPARE(notification.direction(), Qt::RightToLeft); + QCOMPARE(notification.language(), "de"); + QCOMPARE(notification.tag(), "tst"); notification.show(); QTRY_VERIFY2(page.messages.contains("onshow"), page.messages.join("\n").toLatin1().constData()); |