diff --git a/autotests/integration/helper/kill.cpp b/autotests/integration/helper/kill.cpp --- a/autotests/integration/helper/kill.cpp +++ b/autotests/integration/helper/kill.cpp @@ -3,6 +3,7 @@ This file is part of the KDE project. Copyright (C) 2016 Martin Gräßlin +Copyright (C) 2019 David Edmundson This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,22 +24,23 @@ #include #include +#include + int main(int argc, char *argv[]) { qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("wayland")); QApplication app(argc, argv); QWidget w; w.setGeometry(QRect(0, 0, 100, 200)); w.show(); - //after showing the window block the main thread - //1 as we want it to come after the singleshots in qApp construction - QTimer::singleShot(1, []() { - //block + auto freezeHandler = [](int) { while(true) { - sleep(100000); + sleep(10000); } - }); + }; + + signal(SIGUSR1, freezeHandler); return app.exec(); } diff --git a/autotests/integration/shell_client_test.cpp b/autotests/integration/shell_client_test.cpp --- a/autotests/integration/shell_client_test.cpp +++ b/autotests/integration/shell_client_test.cpp @@ -3,6 +3,7 @@ This file is part of the KDE project. Copyright (C) 2016 Martin Gräßlin +Copyright (C) 2019 David Edmundson This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -48,6 +49,7 @@ #include #include #include +#include using namespace KWin; using namespace KWayland::Client; @@ -1133,7 +1135,10 @@ if (shellClientAddedSpy.isEmpty()) { QVERIFY(shellClientAddedSpy.wait()); } + ::kill(process->processId(), SIGUSR1); // send a signal to freeze the process + killClient = shellClientAddedSpy.first().first().value(); + QVERIFY(killClient); QSignalSpy unresponsiveSpy(killClient, &AbstractClient::unresponsiveChanged); QSignalSpy killedSpy(process.data(), static_cast(&QProcess::finished)); QSignalSpy deletedSpy(killClient, &QObject::destroyed);