diff options
Diffstat (limited to 'tests/manual/quick/geopermission/tst_geopermission.qml')
-rw-r--r-- | tests/manual/quick/geopermission/tst_geopermission.qml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/manual/quick/geopermission/tst_geopermission.qml b/tests/manual/quick/geopermission/tst_geopermission.qml new file mode 100644 index 000000000..6d6f4de8b --- /dev/null +++ b/tests/manual/quick/geopermission/tst_geopermission.qml @@ -0,0 +1,28 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtTest +import QtWebEngine + +WebEngineView { + id: webEngineView + width: 200 + height: 200 + url: Qt.resolvedUrl("qrc:/geolocation.html") + property bool deniedGeolocation: false + property bool geoPermissionRequested: false + + onPermissionRequested: function(perm) { + if (perm.feature === WebEnginePermission.Geolocation) { + geoPermissionRequested = true + if (deniedGeolocation) { + perm.deny() + } + else { + perm.grant() + } + } + } + +} |