diff options
author | Florian Bruhin <me@the-compiler.org> | 2022-08-18 11:09:33 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2022-08-18 11:09:33 +0200 |
commit | 62d3a80026d14c5d3ff85d58c3087947c76e4a43 (patch) | |
tree | ddfc0cfb28157f068f3cb2c84deba809d1671beb | |
parent | c9613e09e5244f636c84878ffa5557ff9f0f3601 (diff) | |
download | qutebrowser-62d3a80026d14c5d3ff85d58c3087947c76e4a43.tar.gz qutebrowser-62d3a80026d14c5d3ff85d58c3087947c76e4a43.zip |
tests: Support GetServerInformation for test notification server
Huge thanks to u/SomethingOfAGirl on Reddit for finding out how to make this work!
See https://www.riverbankcomputing.com/pipermail/pyqt/2021-March/043724.html
-rw-r--r-- | qutebrowser/browser/webengine/notification.py | 5 | ||||
-rw-r--r-- | tests/end2end/fixtures/notificationserver.py | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/qutebrowser/browser/webengine/notification.py b/qutebrowser/browser/webengine/notification.py index 72b18fd96..0c4441607 100644 --- a/qutebrowser/browser/webengine/notification.py +++ b/qutebrowser/browser/webengine/notification.py @@ -802,10 +802,7 @@ class DBusNotificationAdapter(AbstractNotificationAdapter): self._dbus_error_str(bus.lastError())) self._quirks = _ServerQuirks() - if not test_service: - # Can't figure out how to make this work with the test server... - # https://www.riverbankcomputing.com/pipermail/pyqt/2021-March/043724.html - self._get_server_info() + self._get_server_info() if self._quirks.skip_capabilities: self._capabilities = _ServerCapabilities.from_list([]) diff --git a/tests/end2end/fixtures/notificationserver.py b/tests/end2end/fixtures/notificationserver.py index 869c6aaa4..bea34c6d3 100644 --- a/tests/end2end/fixtures/notificationserver.py +++ b/tests/end2end/fixtures/notificationserver.py @@ -222,6 +222,14 @@ class TestNotificationServer(QObject): return capabilities @pyqtSlot(QDBusMessage) + def GetServerInformation(self, message: QDBusMessage) -> None: + name = "test notification server" + vendor = "qutebrowser" + version = "v0.0.1" + spec_version = "1.2" + self._bus.send(message.createReply([name, vendor, version, spec_version])) + + @pyqtSlot(QDBusMessage) def CloseNotification(self, dbus_message: QDBusMessage) -> None: assert dbus_message.signature() == 'u' assert dbus_message.type() == QDBusMessage.MethodCallMessage |