[autotests] Try to make PlasmaWindowTest::testCreateDestroyX11PlasmaWindow more robust

The test was racing on build.kde.org and failing due to that. We have
a condition there where we wait for some parts being transmitted through
X and some through Wayland. The test assumed X is faster and failed due
to that.
This commit is contained in:
Martin Flöser 2017-07-25 21:16:23 +02:00
parent c29d6093ba
commit f5f14475b5

View file

@ -146,12 +146,13 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow()
QVERIFY(client->isDecorated()); QVERIFY(client->isDecorated());
QVERIFY(client->isActive()); QVERIFY(client->isActive());
// verify that it gets the keyboard focus // verify that it gets the keyboard focus
QVERIFY(!client->surface()); if (!client->surface()) {
// we don't have a surface yet, so focused keyboard surface if set is not ours // we don't have a surface yet, so focused keyboard surface if set is not ours
QVERIFY(!waylandServer()->seat()->focusedKeyboardSurface()); QVERIFY(!waylandServer()->seat()->focusedKeyboardSurface());
QSignalSpy surfaceChangedSpy(client, &Toplevel::surfaceChanged); QSignalSpy surfaceChangedSpy(client, &Toplevel::surfaceChanged);
QVERIFY(surfaceChangedSpy.isValid()); QVERIFY(surfaceChangedSpy.isValid());
QVERIFY(surfaceChangedSpy.wait()); QVERIFY(surfaceChangedSpy.wait());
}
QVERIFY(client->surface()); QVERIFY(client->surface());
QCOMPARE(waylandServer()->seat()->focusedKeyboardSurface(), client->surface()); QCOMPARE(waylandServer()->seat()->focusedKeyboardSurface(), client->surface());