Commit 965c30f4 authored by David Edmundson's avatar David Edmundson

Register a fake appmenu UI for the appmenu test

parent 2f9d0bd6
...@@ -26,6 +26,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -26,6 +26,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "wayland_server.h" #include "wayland_server.h"
#include "workspace.h" #include "workspace.h"
#include <QDBusConnection>
#include <KWayland/Client/connection_thread.h> #include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/compositor.h> #include <KWayland/Client/compositor.h>
#include <KWayland/Client/shell.h> #include <KWayland/Client/shell.h>
...@@ -961,6 +963,9 @@ void TestShellClient::testX11WindowId() ...@@ -961,6 +963,9 @@ void TestShellClient::testX11WindowId()
void TestShellClient::testAppMenu() void TestShellClient::testAppMenu()
{ {
//register a faux appmenu client
QVERIFY (QDBusConnection::sessionBus().registerService("org.kde.kappmenu"));
QScopedPointer<Surface> surface(Test::createSurface()); QScopedPointer<Surface> surface(Test::createSurface());
QScopedPointer<QObject> shellSurface(Test::createShellSurface(Test::ShellSurfaceType::XdgShellV6, surface.data())); QScopedPointer<QObject> shellSurface(Test::createShellSurface(Test::ShellSurfaceType::XdgShellV6, surface.data()));
auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
...@@ -972,6 +977,8 @@ void TestShellClient::testAppMenu() ...@@ -972,6 +977,8 @@ void TestShellClient::testAppMenu()
QCOMPARE(c->hasApplicationMenu(), true); QCOMPARE(c->hasApplicationMenu(), true);
QCOMPARE(c->applicationMenuServiceName(), QString("service.name")); QCOMPARE(c->applicationMenuServiceName(), QString("service.name"));
QCOMPARE(c->applicationMenuObjectPath(), QString("object/path")); QCOMPARE(c->applicationMenuObjectPath(), QString("object/path"));
QVERIFY (QDBusConnection::sessionBus().unregisterService("org.kde.kappmenu"));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment