aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Flöser <[email protected]>2018-11-15 17:56:07 +0100
committerMartin Flöser <[email protected]>2018-11-15 19:01:51 +0100
commit841750438b459ac9eaf2158b51f1d20f471ac1bb (patch)
tree08aa3e2825999b0443fb55bd0276e3638ba41fa2
parentfb68e162b0c3d5c88ddf83477ade541957c0580f (diff)
Fix KeyboardLayoutTest::testNumLock
Summary: The layout from previous test leaked into this test if all tests are run together. This change ensures that a proper layout for this test is set. Test Plan: Test passes alone and when run together Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D16903
-rw-r--r--autotests/integration/keyboard_layout_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/autotests/integration/keyboard_layout_test.cpp b/autotests/integration/keyboard_layout_test.cpp
index 13fbc9c..da97603 100644
--- a/autotests/integration/keyboard_layout_test.cpp
+++ b/autotests/integration/keyboard_layout_test.cpp
@@ -462,7 +462,15 @@ void KeyboardLayoutTest::testApplicationPolicy()
void KeyboardLayoutTest::testNumLock()
{
qputenv("KWIN_FORCE_NUM_LOCK_EVALUATION", "1");
+ KConfigGroup layoutGroup = kwinApp()->kxkbConfig()->group("Layout");
+ layoutGroup.writeEntry("LayoutList", QStringLiteral("us"));
+ layoutGroup.sync();
+ reconfigureLayouts();
+
auto xkb = input()->keyboard()->xkb();
+ QTRY_COMPARE(xkb->numberOfLayouts(), 1u);
+ QTRY_COMPARE(xkb->layoutName(), QStringLiteral("English (US)"));
+
// by default not set
QVERIFY(!xkb->modifiers().testFlag(Qt::KeypadModifier));
quint32 timestamp = 0;