Warning, file /plasma/kwin/autotests/tabbox/test_tabbox_config.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 KWin - the KDE window manager 0003 This file is part of the KDE project. 0004 0005 SPDX-FileCopyrightText: 2012 Martin Gräßlin <mgraesslin@kde.org> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 #include "tabbox/tabboxconfig.h" 0010 #include <QtTest> 0011 using namespace KWin; 0012 using namespace KWin::TabBox; 0013 0014 class TestTabBoxConfig : public QObject 0015 { 0016 Q_OBJECT 0017 private Q_SLOTS: 0018 void testDefaultCtor(); 0019 void testAssignmentOperator(); 0020 }; 0021 0022 void TestTabBoxConfig::testDefaultCtor() 0023 { 0024 TabBoxConfig config; 0025 QCOMPARE(config.isShowTabBox(), TabBoxConfig::defaultShowTabBox()); 0026 QCOMPARE(config.isHighlightWindows(), TabBoxConfig::defaultHighlightWindow()); 0027 QCOMPARE(config.tabBoxMode(), TabBoxConfig::ClientTabBox); 0028 QCOMPARE(config.clientDesktopMode(), TabBoxConfig::defaultDesktopMode()); 0029 QCOMPARE(config.clientActivitiesMode(), TabBoxConfig::defaultActivitiesMode()); 0030 QCOMPARE(config.clientApplicationsMode(), TabBoxConfig::defaultApplicationsMode()); 0031 QCOMPARE(config.orderMinimizedMode(), TabBoxConfig::defaultOrderMinimizedMode()); 0032 QCOMPARE(config.clientMinimizedMode(), TabBoxConfig::defaultMinimizedMode()); 0033 QCOMPARE(config.showDesktopMode(), TabBoxConfig::defaultShowDesktopMode()); 0034 QCOMPARE(config.clientMultiScreenMode(), TabBoxConfig::defaultMultiScreenMode()); 0035 QCOMPARE(config.clientSwitchingMode(), TabBoxConfig::defaultSwitchingMode()); 0036 QCOMPARE(config.desktopSwitchingMode(), TabBoxConfig::MostRecentlyUsedDesktopSwitching); 0037 QCOMPARE(config.layoutName(), TabBoxConfig::defaultLayoutName()); 0038 } 0039 0040 void TestTabBoxConfig::testAssignmentOperator() 0041 { 0042 TabBoxConfig config; 0043 // changing all values of the config object 0044 config.setShowTabBox(!TabBoxConfig::defaultShowTabBox()); 0045 config.setHighlightWindows(!TabBoxConfig::defaultHighlightWindow()); 0046 config.setTabBoxMode(TabBoxConfig::DesktopTabBox); 0047 config.setClientDesktopMode(TabBoxConfig::AllDesktopsClients); 0048 config.setClientActivitiesMode(TabBoxConfig::AllActivitiesClients); 0049 config.setClientApplicationsMode(TabBoxConfig::OneWindowPerApplication); 0050 config.setOrderMinimizedMode(TabBoxConfig::GroupByMinimized); 0051 config.setClientMinimizedMode(TabBoxConfig::ExcludeMinimizedClients); 0052 config.setShowDesktopMode(TabBoxConfig::ShowDesktopClient); 0053 config.setClientMultiScreenMode(TabBoxConfig::ExcludeCurrentScreenClients); 0054 config.setClientSwitchingMode(TabBoxConfig::StackingOrderSwitching); 0055 config.setDesktopSwitchingMode(TabBoxConfig::StaticDesktopSwitching); 0056 config.setLayoutName(QStringLiteral("grid")); 0057 TabBoxConfig config2; 0058 config2 = config; 0059 // verify the config2 values 0060 QCOMPARE(config2.isShowTabBox(), !TabBoxConfig::defaultShowTabBox()); 0061 QCOMPARE(config2.isHighlightWindows(), !TabBoxConfig::defaultHighlightWindow()); 0062 QCOMPARE(config2.tabBoxMode(), TabBoxConfig::DesktopTabBox); 0063 QCOMPARE(config2.clientDesktopMode(), TabBoxConfig::AllDesktopsClients); 0064 QCOMPARE(config2.clientActivitiesMode(), TabBoxConfig::AllActivitiesClients); 0065 QCOMPARE(config2.clientApplicationsMode(), TabBoxConfig::OneWindowPerApplication); 0066 QCOMPARE(config2.orderMinimizedMode(), TabBoxConfig::GroupByMinimized); 0067 QCOMPARE(config2.clientMinimizedMode(), TabBoxConfig::ExcludeMinimizedClients); 0068 QCOMPARE(config2.showDesktopMode(), TabBoxConfig::ShowDesktopClient); 0069 QCOMPARE(config2.clientMultiScreenMode(), TabBoxConfig::ExcludeCurrentScreenClients); 0070 QCOMPARE(config2.clientSwitchingMode(), TabBoxConfig::StackingOrderSwitching); 0071 QCOMPARE(config2.desktopSwitchingMode(), TabBoxConfig::StaticDesktopSwitching); 0072 QCOMPARE(config2.layoutName(), QStringLiteral("grid")); 0073 } 0074 0075 QTEST_MAIN(TestTabBoxConfig) 0076 0077 #include "test_tabbox_config.moc"