kwin/autotests/tabbox/test_tabbox_handler.cpp
Vlad Zahorodnii 1b2c7b248b Run clazy with qt-keywords fixit
In C++20, there will be emit() class member, which can conflict with the
emit keyword. Given that, there are plans to enable QT_NO_KEYWORDS by
default in the future.

See also
https://lists.qt-project.org/pipermail/development/2020-February/038812.html
2021-06-08 10:49:42 +03:00

52 lines
1.4 KiB
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2012 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "mock_tabboxhandler.h"
#include "clientmodel.h"
#include "../testutils.h"
#include <QtTest>
#include <QX11Info>
using namespace KWin;
class TestTabBoxHandler : public QObject
{
Q_OBJECT
private Q_SLOTS:
void initTestCase();
/**
* Test to verify that update outline does not crash
* if the ModelIndex for which the outline should be
* shown is not valid. That is accessing the Pointer
* to the Client returns an invalid QVariant.
* BUG: 304620
*/
void testDontCrashUpdateOutlineNullClient();
};
void TestTabBoxHandler::initTestCase()
{
qApp->setProperty("x11Connection", QVariant::fromValue<void*>(QX11Info::connection()));
}
void TestTabBoxHandler::testDontCrashUpdateOutlineNullClient()
{
MockTabBoxHandler tabboxhandler;
TabBox::TabBoxConfig config;
config.setTabBoxMode(TabBox::TabBoxConfig::ClientTabBox);
config.setShowTabBox(false);
config.setHighlightWindows(false);
tabboxhandler.setConfig(config);
// now show the tabbox which will attempt to show the outline
tabboxhandler.show();
}
Q_CONSTRUCTOR_FUNCTION(forceXcb)
QTEST_MAIN(TestTabBoxHandler)
#include "test_tabbox_handler.moc"