summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-26 15:02:11 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-03-27 15:30:02 +0100
commit3ab707405a8b108baac259904551725e4a7aa3b3 (patch)
tree794d907f13d20459aae75e3f058e172602855bbc /tests
parent0754bc2d901087ffdd4611bd60bffa814851564c (diff)
downloadqutebrowser-3ab707405a8b108baac259904551725e4a7aa3b3.tar.gz
qutebrowser-3ab707405a8b108baac259904551725e4a7aa3b3.zip
notifications: Basic separation into presenter and adapter
Diffstat (limited to 'tests')
-rw-r--r--tests/end2end/features/test_notifications_bdd.py4
-rw-r--r--tests/end2end/fixtures/notificationserver.py16
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/end2end/features/test_notifications_bdd.py b/tests/end2end/features/test_notifications_bdd.py
index 039239900..6a5bd78a6 100644
--- a/tests/end2end/features/test_notifications_bdd.py
+++ b/tests/end2end/features/test_notifications_bdd.py
@@ -41,7 +41,7 @@ def supports_body_markup(notification_server, quteproc):
notification_server.supports_body_markup = True
quteproc.send_cmd(
":debug-pyeval -q __import__('qutebrowser').browser.webengine.notification."
- "dbus_presenter._fetch_capabilities()")
+ "bridge._adapter._fetch_capabilities()")
quteproc.wait_for(
message="Notification server capabilities: ['actions', 'body-markup']")
@@ -51,7 +51,7 @@ def doesnt_support_body_markup(notification_server, quteproc):
notification_server.supports_body_markup = False
quteproc.send_cmd(
":debug-pyeval -q __import__('qutebrowser').browser.webengine.notification."
- "dbus_presenter._fetch_capabilities()")
+ "bridge._adapter._fetch_capabilities()")
quteproc.wait_for(message="Notification server capabilities: ['actions']")
diff --git a/tests/end2end/fixtures/notificationserver.py b/tests/end2end/fixtures/notificationserver.py
index 0ee77767f..ee12dcba1 100644
--- a/tests/end2end/fixtures/notificationserver.py
+++ b/tests/end2end/fixtures/notificationserver.py
@@ -77,15 +77,15 @@ class TestNotificationServer(QObject):
return False
assert self._bus.registerService(self._service)
assert self._bus.registerObject(
- notification.DBusNotificationPresenter.PATH,
- notification.DBusNotificationPresenter.INTERFACE,
+ notification.DBusNotificationAdapter.PATH,
+ notification.DBusNotificationAdapter.INTERFACE,
self,
QDBusConnection.ExportAllSlots,
)
return True
def unregister(self) -> None:
- self._bus.unregisterObject(notification.DBusNotificationPresenter.PATH)
+ self._bus.unregisterObject(notification.DBusNotificationAdapter.PATH)
assert self._bus.unregisterService(self._service)
def _parse_notify_args(self, appname, replaces_id, icon, title, body, actions,
@@ -149,8 +149,8 @@ class TestNotificationServer(QObject):
def close(self, notification_id: int) -> None:
"""Sends a close notification for the given ID."""
message = QDBusMessage.createSignal(
- notification.DBusNotificationPresenter.PATH,
- notification.DBusNotificationPresenter.INTERFACE,
+ notification.DBusNotificationAdapter.PATH,
+ notification.DBusNotificationAdapter.INTERFACE,
"NotificationClosed")
# The 2 here is the notification removal reason ("dismissed by the user")
@@ -166,8 +166,8 @@ class TestNotificationServer(QObject):
def action(self, notification_id: int, name: str) -> None:
"""Sends an action notification for the given ID."""
message = QDBusMessage.createSignal(
- notification.DBusNotificationPresenter.PATH,
- notification.DBusNotificationPresenter.INTERFACE,
+ notification.DBusNotificationAdapter.PATH,
+ notification.DBusNotificationAdapter.INTERFACE,
"ActionInvoked")
message.setArguments([_as_uint32(notification_id), name])
@@ -212,7 +212,7 @@ def notification_server(qapp):
# a connection on macOS, since it's theoretically possible to run DBus there.
pytest.skip("Skipping DBus on Windows")
- server = TestNotificationServer(notification.DBusNotificationPresenter.TEST_SERVICE)
+ server = TestNotificationServer(notification.DBusNotificationAdapter.TEST_SERVICE)
registered = server.register()
if not registered:
assert not (utils.is_linux and testutils.ON_CI), "Expected DBus on Linux CI"