Commit 18763d14 authored by Xuetian Weng's avatar Xuetian Weng Committed by Xuetian Weng
Browse files

Fix flaky testTextInputV3Interface

In a74c4361, we changed behavior that
every commit() will be followed by a done(), which makes this test might
catch a different done() from server. Change the spy to make sure it
exhaust all other done before checking the one expected.
parent 2ade8111
Pipeline #194496 passed with stage
in 36 minutes and 14 seconds
......@@ -557,6 +557,7 @@ void TestTextInputV3Interface::testMultipleTextinputs()
QVERIFY(m_serverTextInputV3);
QVERIFY(!m_serverTextInputV3->isEnabled());
QSignalSpy doneSpy1(ti1, &TextInputV3::done);
QSignalSpy committedSpy(m_serverTextInputV3, &TextInputV3Interface::stateCommitted);
// Enable ti1
ti1->enable();
......@@ -564,6 +565,7 @@ void TestTextInputV3Interface::testMultipleTextinputs()
QVERIFY(committedSpy.wait());
QCOMPARE(committedSpy.last().at(0).value<quint32>(), 1);
QVERIFY(m_serverTextInputV3->isEnabled());
QVERIFY(doneSpy1.wait());
// Send another three commits on ti1
ti1->enable();
......@@ -572,6 +574,7 @@ void TestTextInputV3Interface::testMultipleTextinputs()
QVERIFY(committedSpy.wait());
QCOMPARE(committedSpy.last().at(0).value<quint32>(), 2);
QVERIFY(m_serverTextInputV3->isEnabled());
QVERIFY(doneSpy1.wait());
ti1->enable();
ti1->set_content_type(QtWayland::zwp_text_input_v3::content_hint_none, QtWayland::zwp_text_input_v3::content_purpose_normal);
......@@ -579,9 +582,9 @@ void TestTextInputV3Interface::testMultipleTextinputs()
QVERIFY(committedSpy.wait());
QCOMPARE(committedSpy.last().at(0).value<quint32>(), 3);
QVERIFY(m_serverTextInputV3->isEnabled());
QVERIFY(doneSpy1.wait());
// at this point total commit count to ti1 is 3
QSignalSpy doneSpy1(ti1, &TextInputV3::done);
QSignalSpy doneSpy2(ti2, &TextInputV3::done);
m_serverTextInputV3->commitString("Hello");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment