autotests: Fix VirtualKeyboardDBusTest

Input method is enabled by default now, adjust the test to that.
This commit is contained in:
Vlad Zahorodnii 2021-06-22 16:28:45 +03:00
parent 4206d8bd9c
commit 5d1062f42d

View file

@ -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)