From 5d1062f42dc007cb1bfe663ff2cdf4d549a82720 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 22 Jun 2021 16:28:45 +0300 Subject: [PATCH] autotests: Fix VirtualKeyboardDBusTest Input method is enabled by default now, adjust the test to that. --- autotests/integration/test_virtualkeyboard_dbus.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/autotests/integration/test_virtualkeyboard_dbus.cpp b/autotests/integration/test_virtualkeyboard_dbus.cpp index e0303cfde2..63945d8d6a 100644 --- a/autotests/integration/test_virtualkeyboard_dbus.cpp +++ b/autotests/integration/test_virtualkeyboard_dbus.cpp @@ -36,6 +36,7 @@ private Q_SLOTS: void testEnabled(); void testRequestEnabled_data(); void testRequestEnabled(); + void init(); void cleanup(); }; @@ -59,6 +60,11 @@ void VirtualKeyboardDBusTest::initTestCase() AdditionalWaylandInterface::TextInputManagerV3)); } +void VirtualKeyboardDBusTest::init() +{ + InputMethod::self()->setEnabled(false); +} + void VirtualKeyboardDBusTest::cleanup() { Test::destroyWaylandConnection(); @@ -116,13 +122,10 @@ void VirtualKeyboardDBusTest::testRequestEnabled() QFETCH(bool, expectedResult); VirtualKeyboardDBus dbus(KWin::InputMethod::self()); - QSignalSpy activateRequestedSpy(&dbus, &VirtualKeyboardDBus::enabledChanged); - QVERIFY(activateRequestedSpy.isValid()); OrgKdeKwinVirtualKeyboardInterface iface(QStringLiteral("org.kde.kwin.testvirtualkeyboard"), QStringLiteral("/VirtualKeyboard"), QDBusConnection::sessionBus()); - + iface.setEnabled(expectedResult); - QCOMPARE(activateRequestedSpy.count(), 1); - QCOMPARE(iface.enabled(), expectedResult); + QTRY_COMPARE(iface.enabled(), expectedResult); } WAYLANDTEST_MAIN(VirtualKeyboardDBusTest)