Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
49 lines
1.5 KiB
Python
49 lines
1.5 KiB
Python
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
#
|
|
# This file is formatted with Python Black
|
|
# mypy: disable-error-code="misc"
|
|
|
|
from tests.templates import init_logger
|
|
|
|
import dbus.service
|
|
|
|
|
|
BUS_NAME = "org.freedesktop.impl.portal.Test"
|
|
MAIN_OBJ = "/org/freedesktop/portal/desktop"
|
|
SYSTEM_BUS = False
|
|
MAIN_IFACE = "org.freedesktop.impl.portal.Lockdown"
|
|
|
|
|
|
logger = init_logger(__name__)
|
|
|
|
|
|
def load(mock, parameters={}):
|
|
logger.debug(f"Loading parameters: {parameters}")
|
|
|
|
mock.AddProperties(
|
|
MAIN_IFACE,
|
|
dbus.Dictionary(
|
|
{
|
|
"disable-printing": dbus.Boolean(
|
|
parameters.get("disable-printing", False)
|
|
),
|
|
"disable-save-to-disk": dbus.Boolean(
|
|
parameters.get("disable-save-to-disk", False)
|
|
),
|
|
"disable-application-handlers": dbus.Boolean(
|
|
parameters.get("disable-application-handlers", False)
|
|
),
|
|
"disable-location": dbus.Boolean(
|
|
parameters.get("disable-location", False)
|
|
),
|
|
"disable-camera": dbus.Boolean(parameters.get("disable-camera", False)),
|
|
"disable-microphone": dbus.Boolean(
|
|
parameters.get("disable-microphone", False)
|
|
),
|
|
"disable-sound-output": dbus.Boolean(
|
|
parameters.get("disable-sound-output", False)
|
|
),
|
|
}
|
|
),
|
|
)
|