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 9e46767b64)

Co-authored-by: Weng Xuetian <wengxt@gmail.com>
wilder/Plasma/6.2
Vlad Zahorodnii 1 year ago
parent e73a1b9564
commit 6776e7256f
  1. 32
      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<KWayland::Client::Surface> surface2(Test::createSurface());
std::unique_ptr<Test::XdgToplevel> 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();

Loading…
Cancel
Save