[autotests] Fix debug console test

Summary:
Use QTRY_COMPARE macro to not fail if signal already sent. Also shorten
timeout on expect to fail test for faster test runs.

Test Plan: Debug console test passes again.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22124
This commit is contained in:
Roman Gilg 2019-06-27 18:52:06 +02:00
parent 349560a78c
commit bc309929a0

View file

@ -392,7 +392,7 @@ void DebugConsoleTest::testWaylandClient()
Test::flushWaylandConnection(); Test::flushWaylandConnection();
qDebug() << rowsRemovedSpy.count(); qDebug() << rowsRemovedSpy.count();
QEXPECT_FAIL("wlShell", "Deleting a ShellSurface does not result in the server removing the ShellClient", Continue); QEXPECT_FAIL("wlShell", "Deleting a ShellSurface does not result in the server removing the ShellClient", Continue);
QVERIFY(rowsRemovedSpy.wait()); QVERIFY(rowsRemovedSpy.wait(500));
surface.reset(); surface.reset();
if (rowsRemovedSpy.isEmpty()) { if (rowsRemovedSpy.isEmpty()) {
@ -449,8 +449,7 @@ void DebugConsoleTest::testInternalWindow()
w->setGeometry(0, 0, 100, 100); w->setGeometry(0, 0, 100, 100);
w->show(); w->show();
QVERIFY(rowsInsertedSpy.wait()); QTRY_COMPARE(rowsInsertedSpy.count(), 1);
QCOMPARE(rowsInsertedSpy.count(), 1);
QCOMPARE(rowsInsertedSpy.first().first().value<QModelIndex>(), internalTopLevelIndex); QCOMPARE(rowsInsertedSpy.first().first().value<QModelIndex>(), internalTopLevelIndex);
QModelIndex clientIndex = model.index(rowsInsertedSpy.first().last().toInt(), 0, internalTopLevelIndex); QModelIndex clientIndex = model.index(rowsInsertedSpy.first().last().toInt(), 0, internalTopLevelIndex);