From fc839d8b29cfff493310905034dc2aa4c60cc7b7 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 8 Jul 2020 13:10:24 +0300 Subject: [PATCH] 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. --- autotests/integration/activities_test.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/autotests/integration/activities_test.cpp b/autotests/integration/activities_test.cpp index 38da8e1e47..9df6ebd3e5 100644 --- a/autotests/integration/activities_test.cpp +++ b/autotests/integration/activities_test.cpp @@ -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 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")));