From 53a0c4faec0d6fd30fa06fc80238af66b373156a Mon Sep 17 00:00:00 2001 From: Carson Black Date: Fri, 20 Mar 2020 12:31:42 -0400 Subject: [PATCH] Add test for application menu in PWM interface Test Plan: See that the test works as expected. Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D28164 --- .../client/test_wayland_windowmanagement.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/wayland/autotests/client/test_wayland_windowmanagement.cpp b/src/wayland/autotests/client/test_wayland_windowmanagement.cpp index 0069e8b5bc..396d8266cf 100644 --- a/src/wayland/autotests/client/test_wayland_windowmanagement.cpp +++ b/src/wayland/autotests/client/test_wayland_windowmanagement.cpp @@ -55,6 +55,7 @@ private Q_SLOTS: void testGeometry(); void testIcon(); void testPid(); + void testApplicationMenu(); void cleanup(); @@ -638,5 +639,22 @@ void TestWindowManagement::testPid() } +void TestWindowManagement::testApplicationMenu() +{ + using namespace KWayland::Client; + + const auto serviceName = QStringLiteral("org.kde.foo"); + const auto objectPath = QStringLiteral("/org/kde/bar"); + + m_windowInterface->setApplicationMenuPaths(serviceName, objectPath); + + QSignalSpy applicationMenuChangedSpy(m_window, &PlasmaWindow::applicationMenuChanged); + QVERIFY(applicationMenuChangedSpy.isValid()); + QVERIFY(applicationMenuChangedSpy.wait()); + + QCOMPARE(m_window->applicationMenuServiceName(), serviceName); + QCOMPARE(m_window->applicationMenuObjectPath(), objectPath); +} + QTEST_MAIN(TestWindowManagement) #include "test_wayland_windowmanagement.moc"