autotests/integration: make inputmethodtest more realstic
When text input gets enabled, the sequence should be 1. enable 2. request to show the panel 3. panel gets added and shown And showing the panel again after hiding is an important case to cover as well.
This commit is contained in:
parent
314b5327b6
commit
7da79f5ec4
1 changed files with 12 additions and 5 deletions
|
@ -129,19 +129,18 @@ void InputMethodTest::testOpenClose()
|
|||
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
|
||||
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
|
||||
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
|
||||
QVERIFY(surfaceConfigureRequestedSpy.wait());
|
||||
|
||||
std::unique_ptr<TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
|
||||
|
||||
QVERIFY(textInput != nullptr);
|
||||
textInput->enable(surface.get());
|
||||
QVERIFY(surfaceConfigureRequestedSpy.wait());
|
||||
|
||||
// Show the keyboard
|
||||
touchNow();
|
||||
QSignalSpy paneladded(kwinApp()->inputMethod(), &KWin::InputMethod::panelChanged);
|
||||
QVERIFY(paneladded.wait());
|
||||
textInput->enable(surface.get());
|
||||
textInput->showInputPanel();
|
||||
QSignalSpy paneladded(kwinApp()->inputMethod(), &KWin::InputMethod::panelChanged);
|
||||
QVERIFY(windowAddedSpy.wait());
|
||||
QCOMPARE(paneladded.count(), 1);
|
||||
|
||||
Window *keyboardClient = windowAddedSpy.last().first().value<Window *>();
|
||||
QVERIFY(keyboardClient);
|
||||
|
@ -164,6 +163,14 @@ void InputMethodTest::testOpenClose()
|
|||
|
||||
QCOMPARE(window->frameGeometry().height(), 1024);
|
||||
|
||||
// show the keyboard again
|
||||
touchNow();
|
||||
textInput->enable(surface.get());
|
||||
textInput->showInputPanel();
|
||||
|
||||
QVERIFY(surfaceConfigureRequestedSpy.wait());
|
||||
QVERIFY(keyboardClient->isShown());
|
||||
|
||||
// Destroy the test window.
|
||||
shellSurface.reset();
|
||||
QVERIFY(Test::waitForWindowDestroyed(window));
|
||||
|
|
Loading…
Reference in a new issue