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