From 7f5f64c0c7bd9f8a6d538001fcd1c183618346ab Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Wed, 28 Aug 2019 19:05:59 +0300 Subject: [PATCH] [autotests] Fix failing autotests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: After recent output-related changes testIdleInhibition and testColorCorrectionNightColor started failing with the following output: ❯ dbus-run-session bin/testIdleInhibition ********* Start testing of TestIdleInhibition ********* Config: Using QtTest library 5.13.0, Qt 5.13.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 9.1.0) QFATAL : TestIdleInhibition::initTestCase() ASSERT: "mode.size.isValid()" in file /home/vlad/Workspace/KDE/src/frameworks/kwayland/src/server/outputdevice_interface.cpp, line 188 FAIL! : TestIdleInhibition::initTestCase() Received a fatal error. Loc: [Unknown file(0)] Totals: 0 passed, 1 failed, 0 skipped, 0 blacklisted, 13ms ********* Finished testing of TestIdleInhibition ******** Apparently, they both don't initialize virtual outputs properly. Reviewers: #kwin, romangg Reviewed By: #kwin, romangg Subscribers: romangg, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D23539 --- autotests/integration/colorcorrect_nightcolor_test.cpp | 1 + autotests/integration/idle_inhibition_test.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/autotests/integration/colorcorrect_nightcolor_test.cpp b/autotests/integration/colorcorrect_nightcolor_test.cpp index 14b65c7cc2..bc77130c38 100644 --- a/autotests/integration/colorcorrect_nightcolor_test.cpp +++ b/autotests/integration/colorcorrect_nightcolor_test.cpp @@ -49,6 +49,7 @@ void ColorCorrectNightColorTest::initTestCase() { QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); + kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); diff --git a/autotests/integration/idle_inhibition_test.cpp b/autotests/integration/idle_inhibition_test.cpp index efbe3e48da..8ea9721778 100644 --- a/autotests/integration/idle_inhibition_test.cpp +++ b/autotests/integration/idle_inhibition_test.cpp @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "kwin_wayland_test.h" +#include "platform.h" #include "shell_client.h" #include "wayland_server.h" #include "workspace.h" @@ -58,7 +59,9 @@ void TestIdleInhibition::initTestCase() QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); QVERIFY(workspaceCreatedSpy.isValid()); + kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); + QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); kwinApp()->start(); QVERIFY(workspaceCreatedSpy.wait());