Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/effects/scripted_effects_test.cpp
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Line(s) | |||||
180 | void ScriptedEffectsTest::init() | 180 | void ScriptedEffectsTest::init() | ||
181 | { | 181 | { | ||
182 | QVERIFY(Test::setupWaylandConnection()); | 182 | QVERIFY(Test::setupWaylandConnection()); | ||
183 | } | 183 | } | ||
184 | 184 | | |||
185 | void ScriptedEffectsTest::cleanup() | 185 | void ScriptedEffectsTest::cleanup() | ||
186 | { | 186 | { | ||
187 | Test::destroyWaylandConnection(); | 187 | Test::destroyWaylandConnection(); | ||
188 | auto *e = static_cast<EffectsHandlerImpl*>(effects); | 188 | | ||
189 | while (!e->loadedEffects().isEmpty()) { | 189 | auto effectsImpl = static_cast<EffectsHandlerImpl *>(effects); | ||
190 | const QString effect = e->loadedEffects().first(); | 190 | effectsImpl->unloadAllEffects(); | ||
191 | e->unloadEffect(effect); | 191 | QVERIFY(effectsImpl->loadedEffects().isEmpty()); | ||
192 | QVERIFY(!e->isEffectLoaded(effect)); | 192 | | ||
193 | } | | |||
194 | KWin::VirtualDesktopManager::self()->setCurrent(1); | 193 | KWin::VirtualDesktopManager::self()->setCurrent(1); | ||
195 | } | 194 | } | ||
196 | 195 | | |||
197 | void ScriptedEffectsTest::testEffectsHandler() | 196 | void ScriptedEffectsTest::testEffectsHandler() | ||
198 | { | 197 | { | ||
199 | // this triggers and tests some of the signals in EffectHandler, which is exposed to JS as context property "effects" | 198 | // this triggers and tests some of the signals in EffectHandler, which is exposed to JS as context property "effects" | ||
200 | auto *effect = new ScriptedEffectWithDebugSpy; // cleaned up in ::clean | 199 | auto *effect = new ScriptedEffectWithDebugSpy; // cleaned up in ::clean | ||
201 | QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput); | 200 | QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput); | ||
▲ Show 20 Lines • Show All 591 Lines • Show Last 20 Lines |