Changeset View
Changeset View
Standalone View
Standalone View
autotests/test_scripted_effectloader.cpp
| Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 99 | { | |||
|---|---|---|---|---|---|
| 104 | QTest::newRow("blur") << QStringLiteral("blur") << false; | 104 | QTest::newRow("blur") << QStringLiteral("blur") << false; | ||
| 105 | QTest::newRow("Colorpicker") << QStringLiteral("colorpicker") << false; | 105 | QTest::newRow("Colorpicker") << QStringLiteral("colorpicker") << false; | ||
| 106 | QTest::newRow("Contrast") << QStringLiteral("contrast") << false; | 106 | QTest::newRow("Contrast") << QStringLiteral("contrast") << false; | ||
| 107 | QTest::newRow("CoverSwitch") << QStringLiteral("coverswitch") << false; | 107 | QTest::newRow("CoverSwitch") << QStringLiteral("coverswitch") << false; | ||
| 108 | QTest::newRow("Cube") << QStringLiteral("cube") << false; | 108 | QTest::newRow("Cube") << QStringLiteral("cube") << false; | ||
| 109 | QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false; | 109 | QTest::newRow("CubeSlide") << QStringLiteral("cubeslide") << false; | ||
| 110 | QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << false; | 110 | QTest::newRow("DesktopGrid") << QStringLiteral("desktopgrid") << false; | ||
| 111 | QTest::newRow("DimInactive") << QStringLiteral("diminactive") << false; | 111 | QTest::newRow("DimInactive") << QStringLiteral("diminactive") << false; | ||
| 112 | QTest::newRow("DimScreen") << QStringLiteral("dimscreen") << false; | | |||
| 113 | QTest::newRow("FallApart") << QStringLiteral("fallapart") << false; | 112 | QTest::newRow("FallApart") << QStringLiteral("fallapart") << false; | ||
| 114 | QTest::newRow("FlipSwitch") << QStringLiteral("flipswitch") << false; | 113 | QTest::newRow("FlipSwitch") << QStringLiteral("flipswitch") << false; | ||
| 115 | QTest::newRow("Glide") << QStringLiteral("glide") << false; | 114 | QTest::newRow("Glide") << QStringLiteral("glide") << false; | ||
| 116 | QTest::newRow("HighlightWindow") << QStringLiteral("highlightwindow") << false; | 115 | QTest::newRow("HighlightWindow") << QStringLiteral("highlightwindow") << false; | ||
| 117 | QTest::newRow("Invert") << QStringLiteral("invert") << false; | 116 | QTest::newRow("Invert") << QStringLiteral("invert") << false; | ||
| 118 | QTest::newRow("Kscreen") << QStringLiteral("kscreen") << false; | 117 | QTest::newRow("Kscreen") << QStringLiteral("kscreen") << false; | ||
| 119 | QTest::newRow("Logout") << QStringLiteral("logout") << false; | 118 | QTest::newRow("Logout") << QStringLiteral("logout") << false; | ||
| 120 | QTest::newRow("LookingGlass") << QStringLiteral("lookingglass") << false; | 119 | QTest::newRow("LookingGlass") << QStringLiteral("lookingglass") << false; | ||
| Show All 20 Lines | |||||
| 141 | QTest::newRow("Zoom") << QStringLiteral("zoom") << false; | 140 | QTest::newRow("Zoom") << QStringLiteral("zoom") << false; | ||
| 142 | QTest::newRow("Non Existing") << QStringLiteral("InvalidName") << false; | 141 | QTest::newRow("Non Existing") << QStringLiteral("InvalidName") << false; | ||
| 143 | QTest::newRow("Fade - without kwin4_effect") << QStringLiteral("fade") << false; | 142 | QTest::newRow("Fade - without kwin4_effect") << QStringLiteral("fade") << false; | ||
| 144 | QTest::newRow("Fade + kwin4_effect") << QStringLiteral("kwin4_effect_fade") << true; | 143 | QTest::newRow("Fade + kwin4_effect") << QStringLiteral("kwin4_effect_fade") << true; | ||
| 145 | QTest::newRow("Fade + kwin4_effect + CS") << QStringLiteral("kwin4_eFfect_fAde") << true; | 144 | QTest::newRow("Fade + kwin4_effect + CS") << QStringLiteral("kwin4_eFfect_fAde") << true; | ||
| 146 | QTest::newRow("FadeDesktop") << QStringLiteral("kwin4_effect_fadedesktop") << true; | 145 | QTest::newRow("FadeDesktop") << QStringLiteral("kwin4_effect_fadedesktop") << true; | ||
| 147 | QTest::newRow("FrozenApp") << QStringLiteral("kwin4_effect_frozenapp") << true; | 146 | QTest::newRow("FrozenApp") << QStringLiteral("kwin4_effect_frozenapp") << true; | ||
| 148 | QTest::newRow("DialogParent") << QStringLiteral("kwin4_effect_dialogparent") << true; | 147 | QTest::newRow("DialogParent") << QStringLiteral("kwin4_effect_dialogparent") << true; | ||
| 148 | QTest::newRow("DimScreen") << QStringLiteral("kwin4_effect_dimscreen") << true; | ||||
| 149 | QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << true; | 149 | QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << true; | ||
| 150 | QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << true; | 150 | QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << true; | ||
| 151 | QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << true; | 151 | QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << true; | ||
| 152 | QTest::newRow("Scale") << QStringLiteral("kwin4_effect_scale") << true; | 152 | QTest::newRow("Scale") << QStringLiteral("kwin4_effect_scale") << true; | ||
| 153 | QTest::newRow("Squash") << QStringLiteral("kwin4_effect_squash") << true; | 153 | QTest::newRow("Squash") << QStringLiteral("kwin4_effect_squash") << true; | ||
| 154 | QTest::newRow("Translucency") << QStringLiteral("kwin4_effect_translucency") << true; | 154 | QTest::newRow("Translucency") << QStringLiteral("kwin4_effect_translucency") << true; | ||
| 155 | } | 155 | } | ||
| 156 | 156 | | |||
| Show All 14 Lines | 169 | if (expected) { | |||
| 171 | QVERIFY(!loader.isEffectSupported(name)); | 171 | QVERIFY(!loader.isEffectSupported(name)); | ||
| 172 | } | 172 | } | ||
| 173 | } | 173 | } | ||
| 174 | 174 | | |||
| 175 | void TestScriptedEffectLoader::testKnownEffects() | 175 | void TestScriptedEffectLoader::testKnownEffects() | ||
| 176 | { | 176 | { | ||
| 177 | QStringList expectedEffects; | 177 | QStringList expectedEffects; | ||
| 178 | expectedEffects << QStringLiteral("kwin4_effect_dialogparent") | 178 | expectedEffects << QStringLiteral("kwin4_effect_dialogparent") | ||
| 179 | << QStringLiteral("kwin4_effect_dimscreen") | ||||
| 179 | << QStringLiteral("kwin4_effect_fade") | 180 | << QStringLiteral("kwin4_effect_fade") | ||
| 180 | << QStringLiteral("kwin4_effect_fadedesktop") | 181 | << QStringLiteral("kwin4_effect_fadedesktop") | ||
| 181 | << QStringLiteral("kwin4_effect_frozenapp") | 182 | << QStringLiteral("kwin4_effect_frozenapp") | ||
| 182 | << QStringLiteral("kwin4_effect_login") | 183 | << QStringLiteral("kwin4_effect_login") | ||
| 183 | << QStringLiteral("kwin4_effect_logout") | 184 | << QStringLiteral("kwin4_effect_logout") | ||
| 184 | << QStringLiteral("kwin4_effect_maximize") | 185 | << QStringLiteral("kwin4_effect_maximize") | ||
| 185 | << QStringLiteral("kwin4_effect_scale") | 186 | << QStringLiteral("kwin4_effect_scale") | ||
| 186 | << QStringLiteral("kwin4_effect_squash") | 187 | << QStringLiteral("kwin4_effect_squash") | ||
| Show All 15 Lines | 200 | { | |||
| 202 | 203 | | |||
| 203 | QTest::newRow("Non Existing") << QStringLiteral("InvalidName") << false; | 204 | QTest::newRow("Non Existing") << QStringLiteral("InvalidName") << false; | ||
| 204 | QTest::newRow("Fade - without kwin4_effect") << QStringLiteral("fade") << false; | 205 | QTest::newRow("Fade - without kwin4_effect") << QStringLiteral("fade") << false; | ||
| 205 | QTest::newRow("Fade + kwin4_effect") << QStringLiteral("kwin4_effect_fade") << true; | 206 | QTest::newRow("Fade + kwin4_effect") << QStringLiteral("kwin4_effect_fade") << true; | ||
| 206 | QTest::newRow("Fade + kwin4_effect + CS") << QStringLiteral("kwin4_eFfect_fAde") << true; | 207 | QTest::newRow("Fade + kwin4_effect + CS") << QStringLiteral("kwin4_eFfect_fAde") << true; | ||
| 207 | QTest::newRow("FadeDesktop") << QStringLiteral("kwin4_effect_fadedesktop") << true; | 208 | QTest::newRow("FadeDesktop") << QStringLiteral("kwin4_effect_fadedesktop") << true; | ||
| 208 | QTest::newRow("FrozenApp") << QStringLiteral("kwin4_effect_frozenapp") << true; | 209 | QTest::newRow("FrozenApp") << QStringLiteral("kwin4_effect_frozenapp") << true; | ||
| 209 | QTest::newRow("DialogParent") << QStringLiteral("kwin4_effect_dialogparent") << true; | 210 | QTest::newRow("DialogParent") << QStringLiteral("kwin4_effect_dialogparent") << true; | ||
| 211 | QTest::newRow("DimScreen") << QStringLiteral("kwin4_effect_dimscreen") << true; | ||||
| 210 | QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << true; | 212 | QTest::newRow("Login") << QStringLiteral("kwin4_effect_login") << true; | ||
| 211 | QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << true; | 213 | QTest::newRow("Logout") << QStringLiteral("kwin4_effect_logout") << true; | ||
| 212 | QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << true; | 214 | QTest::newRow("Maximize") << QStringLiteral("kwin4_effect_maximize") << true; | ||
| 213 | QTest::newRow("Scale") << QStringLiteral("kwin4_effect_scale") << true; | 215 | QTest::newRow("Scale") << QStringLiteral("kwin4_effect_scale") << true; | ||
| 214 | QTest::newRow("Squash") << QStringLiteral("kwin4_effect_squash") << true; | 216 | QTest::newRow("Squash") << QStringLiteral("kwin4_effect_squash") << true; | ||
| 215 | QTest::newRow("Translucency") << QStringLiteral("kwin4_effect_translucency") << true; | 217 | QTest::newRow("Translucency") << QStringLiteral("kwin4_effect_translucency") << true; | ||
| 216 | } | 218 | } | ||
| 217 | 219 | | |||
| ▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Line(s) | 351 | { | |||
| 352 | 354 | | |||
| 353 | KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 355 | KSharedConfig::Ptr config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
| 354 | 356 | | |||
| 355 | const QString kwin4 = QStringLiteral("kwin4_effect_"); | 357 | const QString kwin4 = QStringLiteral("kwin4_effect_"); | ||
| 356 | 358 | | |||
| 357 | // prepare the configuration to hard enable/disable the effects we want to load | 359 | // prepare the configuration to hard enable/disable the effects we want to load | ||
| 358 | KConfigGroup plugins = config->group("Plugins"); | 360 | KConfigGroup plugins = config->group("Plugins"); | ||
| 359 | plugins.writeEntry(kwin4 + QStringLiteral("dialogparentEnabled"), false); | 361 | plugins.writeEntry(kwin4 + QStringLiteral("dialogparentEnabled"), false); | ||
| 362 | plugins.writeEntry(kwin4 + QStringLiteral("dimscreenEnabled"), false); | ||||
| 360 | plugins.writeEntry(kwin4 + QStringLiteral("fadeEnabled"), false); | 363 | plugins.writeEntry(kwin4 + QStringLiteral("fadeEnabled"), false); | ||
| 361 | plugins.writeEntry(kwin4 + QStringLiteral("fadedesktopEnabled"), false); | 364 | plugins.writeEntry(kwin4 + QStringLiteral("fadedesktopEnabled"), false); | ||
| 362 | plugins.writeEntry(kwin4 + QStringLiteral("frozenappEnabled"), false); | 365 | plugins.writeEntry(kwin4 + QStringLiteral("frozenappEnabled"), false); | ||
| 363 | plugins.writeEntry(kwin4 + QStringLiteral("loginEnabled"), false); | 366 | plugins.writeEntry(kwin4 + QStringLiteral("loginEnabled"), false); | ||
| 364 | plugins.writeEntry(kwin4 + QStringLiteral("logoutEnabled"), false); | 367 | plugins.writeEntry(kwin4 + QStringLiteral("logoutEnabled"), false); | ||
| 365 | plugins.writeEntry(kwin4 + QStringLiteral("maximizeEnabled"), false); | 368 | plugins.writeEntry(kwin4 + QStringLiteral("maximizeEnabled"), false); | ||
| 366 | plugins.writeEntry(kwin4 + QStringLiteral("scaleEnabled"), false); | 369 | plugins.writeEntry(kwin4 + QStringLiteral("scaleEnabled"), false); | ||
| 367 | plugins.writeEntry(kwin4 + QStringLiteral("squashEnabled"), false); | 370 | plugins.writeEntry(kwin4 + QStringLiteral("squashEnabled"), false); | ||
| ▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines | |||||