Commit fc839d8b authored by Vlad Zahorodnii's avatar Vlad Zahorodnii Committed by Vlad Zahorodnii
Browse files

Fix testActivities

Currently, the test passes because the activities controller doesn't
have enough time to fetch all activities. So, the test client won't be
placed on the current activity.

Since the Workspace is now created before starting the Xwayland, we now
spin the event loop, which allows the activities controller to fetch the
list of all activities and so the test client will be placed on the
current activity, i.e. client->isOnAllActivities() will no longer return
true.

This change fixes wrong assumptions in the test and makes it robust.
parent 5dbb52de
......@@ -105,8 +105,7 @@ struct XcbConnectionDeleter
void ActivitiesTest::testSetOnActivitiesValidates()
{
// this test creates a Client and sets it on activities which don't exist
// that should result in the window being on all activities
// this test verifies that windows can't be placed on activities that don't exist
// create an xcb window
QScopedPointer<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr));
QVERIFY(!xcb_connection_has_error(c.data()));
......@@ -142,13 +141,7 @@ void ActivitiesTest::testSetOnActivitiesValidates()
QVERIFY(!Activities::self()->all().contains(QStringLiteral("foo")));
QVERIFY(!Activities::self()->all().contains(QStringLiteral("bar")));
//setting the client to an invalid activities should result in the client being on all activities
client->setOnActivity(QStringLiteral("foo"), true);
QVERIFY(client->isOnAllActivities());
QVERIFY(!client->activities().contains(QLatin1String("foo")));
client->setOnActivities(QStringList{QStringLiteral("foo"), QStringLiteral("bar")});
QVERIFY(client->isOnAllActivities());
QVERIFY(!client->activities().contains(QLatin1String("foo")));
QVERIFY(!client->activities().contains(QLatin1String("bar")));
......
Markdown is supported
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