Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/effects/scripted_effects_test.cpp
Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Line(s) | 197 | { | |||
---|---|---|---|---|---|
206 | QVERIFY(effect->load("effectsHandler")); | 206 | QVERIFY(effect->load("effectsHandler")); | ||
207 | 207 | | |||
208 | // trigger windowAdded signal | 208 | // trigger windowAdded signal | ||
209 | 209 | | |||
210 | // create a window | 210 | // create a window | ||
211 | using namespace KWayland::Client; | 211 | using namespace KWayland::Client; | ||
212 | auto *surface = Test::createSurface(Test::waylandCompositor()); | 212 | auto *surface = Test::createSurface(Test::waylandCompositor()); | ||
213 | QVERIFY(surface); | 213 | QVERIFY(surface); | ||
214 | auto *shellSurface = Test::createXdgShellV6Surface(surface, surface); | 214 | auto *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
215 | QVERIFY(shellSurface); | 215 | QVERIFY(shellSurface); | ||
216 | shellSurface->setTitle("WindowA"); | 216 | shellSurface->setTitle("WindowA"); | ||
217 | auto *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | 217 | auto *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | ||
218 | QVERIFY(c); | 218 | QVERIFY(c); | ||
219 | QCOMPARE(workspace()->activeClient(), c); | 219 | QCOMPARE(workspace()->activeClient(), c); | ||
220 | 220 | | |||
221 | waitFor("windowAdded - WindowA"); | 221 | waitFor("windowAdded - WindowA"); | ||
222 | waitFor("stackingOrder - 1 WindowA"); | 222 | waitFor("stackingOrder - 1 WindowA"); | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 277 | { | |||
285 | auto *effect = new ScriptedEffectWithDebugSpy; | 285 | auto *effect = new ScriptedEffectWithDebugSpy; | ||
286 | QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput); | 286 | QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput); | ||
287 | QVERIFY(effect->load(file)); | 287 | QVERIFY(effect->load(file)); | ||
288 | 288 | | |||
289 | // animated after window added connect | 289 | // animated after window added connect | ||
290 | using namespace KWayland::Client; | 290 | using namespace KWayland::Client; | ||
291 | auto *surface = Test::createSurface(Test::waylandCompositor()); | 291 | auto *surface = Test::createSurface(Test::waylandCompositor()); | ||
292 | QVERIFY(surface); | 292 | QVERIFY(surface); | ||
293 | auto *shellSurface = Test::createXdgShellV6Surface(surface, surface); | 293 | auto *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
294 | QVERIFY(shellSurface); | 294 | QVERIFY(shellSurface); | ||
295 | shellSurface->setTitle("Window 1"); | 295 | shellSurface->setTitle("Window 1"); | ||
296 | auto *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | 296 | auto *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | ||
297 | QVERIFY(c); | 297 | QVERIFY(c); | ||
298 | QCOMPARE(workspace()->activeClient(), c); | 298 | QCOMPARE(workspace()->activeClient(), c); | ||
299 | 299 | | |||
300 | { | 300 | { | ||
301 | const auto state = effect->state(); | 301 | const auto state = effect->state(); | ||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 382 | { | |||
393 | //shown as being someone else | 393 | //shown as being someone else | ||
394 | auto effectOther = new ScriptedEffectWithDebugSpy(); | 394 | auto effectOther = new ScriptedEffectWithDebugSpy(); | ||
395 | QVERIFY(effectOther->load("screenEdgeTouchTest")); | 395 | QVERIFY(effectOther->load("screenEdgeTouchTest")); | ||
396 | QSignalSpy isActiveFullScreenEffectSpyOther(effectOther, &ScriptedEffect::isActiveFullScreenEffectChanged); | 396 | QSignalSpy isActiveFullScreenEffectSpyOther(effectOther, &ScriptedEffect::isActiveFullScreenEffectChanged); | ||
397 | 397 | | |||
398 | using namespace KWayland::Client; | 398 | using namespace KWayland::Client; | ||
399 | auto *surface = Test::createSurface(Test::waylandCompositor()); | 399 | auto *surface = Test::createSurface(Test::waylandCompositor()); | ||
400 | QVERIFY(surface); | 400 | QVERIFY(surface); | ||
401 | auto *shellSurface = Test::createXdgShellV6Surface(surface, surface); | 401 | auto *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
402 | QVERIFY(shellSurface); | 402 | QVERIFY(shellSurface); | ||
403 | shellSurface->setTitle("Window 1"); | 403 | shellSurface->setTitle("Window 1"); | ||
404 | auto *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | 404 | auto *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | ||
405 | QVERIFY(c); | 405 | QVERIFY(c); | ||
406 | QCOMPARE(workspace()->activeClient(), c); | 406 | QCOMPARE(workspace()->activeClient(), c); | ||
407 | 407 | | |||
408 | QCOMPARE(effects->hasActiveFullScreenEffect(), false); | 408 | QCOMPARE(effects->hasActiveFullScreenEffect(), false); | ||
409 | QCOMPARE(effectMain->isActiveFullScreenEffect(), false); | 409 | QCOMPARE(effectMain->isActiveFullScreenEffect(), false); | ||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 449 | { | |||
457 | QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput); | 457 | QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput); | ||
458 | QVERIFY(effectOutputSpy.isValid()); | 458 | QVERIFY(effectOutputSpy.isValid()); | ||
459 | QVERIFY(effect->load(file)); | 459 | QVERIFY(effect->load(file)); | ||
460 | 460 | | |||
461 | // create a window | 461 | // create a window | ||
462 | using namespace KWayland::Client; | 462 | using namespace KWayland::Client; | ||
463 | auto *surface = Test::createSurface(Test::waylandCompositor()); | 463 | auto *surface = Test::createSurface(Test::waylandCompositor()); | ||
464 | QVERIFY(surface); | 464 | QVERIFY(surface); | ||
465 | auto *shellSurface = Test::createXdgShellV6Surface(surface, surface); | 465 | auto *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
466 | QVERIFY(shellSurface); | 466 | QVERIFY(shellSurface); | ||
467 | auto *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | 467 | auto *c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | ||
468 | QVERIFY(c); | 468 | QVERIFY(c); | ||
469 | QCOMPARE(workspace()->activeClient(), c); | 469 | QCOMPARE(workspace()->activeClient(), c); | ||
470 | 470 | | |||
471 | // no active animations at the beginning | 471 | // no active animations at the beginning | ||
472 | QCOMPARE(effect->state().count(), 0); | 472 | QCOMPARE(effect->state().count(), 0); | ||
473 | 473 | | |||
▲ Show 20 Lines • Show All 318 Lines • Show Last 20 Lines |