[autotests] Fix failing autotests

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
This commit is contained in:
Vlad Zagorodniy 2019-08-28 19:05:59 +03:00
parent ae55e37660
commit 7f5f64c0c7
2 changed files with 4 additions and 0 deletions

View file

@ -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));

View file

@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#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());