From 6776e7256feb47fd36aed0ef58f079b3e69d3b7c Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 15 Oct 2024 10:58:08 +0000 Subject: [PATCH] Cleanup InputMethodTest::testV3AutoCommit Since we removed auto commit on input method forwarded key event, just remove the test for it all together. (cherry picked from commit 9e46767b64490f8208198c32bb1075349c119772) Co-authored-by: Weng Xuetian --- autotests/integration/inputmethod_test.cpp | 32 ++++------------------ 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/autotests/integration/inputmethod_test.cpp b/autotests/integration/inputmethod_test.cpp index 43e09466b9..8069a62a90 100644 --- a/autotests/integration/inputmethod_test.cpp +++ b/autotests/integration/inputmethod_test.cpp @@ -845,26 +845,6 @@ void InputMethodTest::testV3AutoCommit() QCOMPARE(textInputCommitTextSpy.last()[0].toString(), "commit1"); QCOMPARE(textInputPreeditSpy.last()[0].toString(), QString()); - // ****************** - // Grabbing key press - zwp_input_method_context_v1_grab_keyboard(context); - textInputV3->commit(); - zwp_input_method_context_v1_preedit_string(context, 1, "preedit2", "commit2"); - - QVERIFY(textInputPreeditSpy.wait()); - QCOMPARE(textInputPreeditSpy.last()[0].toString(), QString("preedit2")); - - // a key does nothing, it will go to the input method - Test::keyboardKeyPressed(KEY_B, timestamp++); - Test::keyboardKeyReleased(KEY_B, timestamp++); - QVERIFY(!textInputCommitTextSpy.wait()); - - // then the input method forwards the key - zwp_input_method_context_v1_key(context, 2, timestamp, KEY_B, uint32_t(KeyboardKeyState::Pressed)); - zwp_input_method_context_v1_key(context, 2, timestamp, KEY_B, uint32_t(KeyboardKeyState::Released)); - - QVERIFY(!textInputCommitTextSpy.wait()); - // ************** // Mouse clicks QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded); @@ -878,9 +858,9 @@ void InputMethodTest::testV3AutoCommit() auto textInputWindow = *it; textInputV3->commit(); - zwp_input_method_context_v1_preedit_string(context, 1, "preedit3", "commit3"); + zwp_input_method_context_v1_preedit_string(context, 1, "preedit2", "commit2"); QVERIFY(textInputPreeditSpy.wait()); - QCOMPARE(textInputPreeditSpy.last()[0].toString(), QString("preedit3")); + QCOMPARE(textInputPreeditSpy.last()[0].toString(), QString("preedit2")); // mouse clicks on a VK does not submit Test::pointerMotion(textInputWindow->frameGeometry().center(), timestamp++); @@ -894,15 +874,15 @@ void InputMethodTest::testV3AutoCommit() Test::pointerButtonReleased(1, timestamp++); QVERIFY(textInputCommitTextSpy.wait()); - QCOMPARE(textInputCommitTextSpy.last()[0].toString(), "commit3"); + QCOMPARE(textInputCommitTextSpy.last()[0].toString(), "commit2"); QCOMPARE(textInputPreeditSpy.last()[0].toString(), QString()); // ***************** // Change focus textInputV3->commit(); - zwp_input_method_context_v1_preedit_string(context, 1, "preedit4", "commit4"); + zwp_input_method_context_v1_preedit_string(context, 1, "preedit3", "commit3"); QVERIFY(textInputPreeditSpy.wait()); - QCOMPARE(textInputPreeditSpy.last()[0].toString(), QString("preedit4")); + QCOMPARE(textInputPreeditSpy.last()[0].toString(), QString("preedit3")); std::unique_ptr surface2(Test::createSurface()); std::unique_ptr shellSurface2(Test::createXdgToplevelSurface(surface2.get())); @@ -911,7 +891,7 @@ void InputMethodTest::testV3AutoCommit() // these variables refer to the old window QVERIFY(textInputCommitTextSpy.wait()); - QCOMPARE(textInputCommitTextSpy.last()[0].toString(), "commit4"); + QCOMPARE(textInputCommitTextSpy.last()[0].toString(), "commit3"); QCOMPARE(textInputPreeditSpy.last()[0].toString(), QString()); shellSurface.reset();