Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/quick_tiling_test.cpp
Show First 20 Lines • Show All 464 Lines • ▼ Show 20 Line(s) | 454 | { | |||
---|---|---|---|---|---|
465 | auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 465 | auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
466 | 466 | | |||
467 | QVERIFY(c); | 467 | QVERIFY(c); | ||
468 | QCOMPARE(workspace()->activeClient(), c); | 468 | QCOMPARE(workspace()->activeClient(), c); | ||
469 | QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); | 469 | QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); | ||
470 | QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); | 470 | QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); | ||
471 | QCOMPARE(c->maximizeMode(), MaximizeRestore); | 471 | QCOMPARE(c->maximizeMode(), MaximizeRestore); | ||
472 | QVERIFY(configureRequestedSpy.wait()); | 472 | QVERIFY(configureRequestedSpy.wait()); | ||
473 | QCOMPARE(configureRequestedSpy.count(), 2); | 473 | QTRY_COMPARE(configureRequestedSpy.count(), 2); | ||
474 | 474 | | |||
475 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | 475 | QSignalSpy quickTileChangedSpy(c, &AbstractClient::quickTileModeChanged); | ||
476 | QVERIFY(quickTileChangedSpy.isValid()); | 476 | QVERIFY(quickTileChangedSpy.isValid()); | ||
477 | 477 | | |||
478 | workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp); | 478 | workspace()->performWindowOperation(c, Options::UnrestrictedMoveOp); | ||
479 | QCOMPARE(c, workspace()->getMovingClient()); | 479 | QCOMPARE(c, workspace()->getMovingClient()); | ||
480 | QCOMPARE(Cursor::pos(), QPoint(49, 24)); | 480 | QCOMPARE(Cursor::pos(), QPoint(49, 24)); | ||
481 | QVERIFY(configureRequestedSpy.wait()); | 481 | QVERIFY(configureRequestedSpy.wait()); | ||
482 | QCOMPARE(configureRequestedSpy.count(), 3); | 482 | QCOMPARE(configureRequestedSpy.count(), 3); | ||
483 | 483 | | |||
484 | QFETCH(QPoint, targetPos); | 484 | QFETCH(QPoint, targetPos); | ||
485 | quint32 timestamp = 1; | 485 | quint32 timestamp = 1; | ||
486 | kwinApp()->platform()->pointerMotion(targetPos, timestamp++); | 486 | kwinApp()->platform()->pointerMotion(targetPos, timestamp++); | ||
487 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | 487 | kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++); | ||
488 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | 488 | kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++); | ||
489 | QCOMPARE(Cursor::pos(), targetPos); | 489 | QCOMPARE(Cursor::pos(), targetPos); | ||
490 | QVERIFY(!workspace()->getMovingClient()); | 490 | QVERIFY(!workspace()->getMovingClient()); | ||
491 | 491 | | |||
492 | QCOMPARE(quickTileChangedSpy.count(), 1); | 492 | QCOMPARE(quickTileChangedSpy.count(), 1); | ||
493 | QTEST(c->quickTileMode(), "expectedMode"); | 493 | QTEST(c->quickTileMode(), "expectedMode"); | ||
494 | QVERIFY(configureRequestedSpy.wait()); | 494 | QVERIFY(configureRequestedSpy.wait()); | ||
495 | QEXPECT_FAIL("", "BUG 388072", Continue); | | |||
496 | QCOMPARE(configureRequestedSpy.count(), 4); | 495 | QCOMPARE(configureRequestedSpy.count(), 4); | ||
497 | QEXPECT_FAIL("", "BUG 388072", Continue); | | |||
498 | QCOMPARE(false, configureRequestedSpy.last().first().toSize().isEmpty()); | 496 | QCOMPARE(false, configureRequestedSpy.last().first().toSize().isEmpty()); | ||
499 | } | 497 | } | ||
500 | 498 | | |||
501 | struct XcbConnectionDeleter | 499 | struct XcbConnectionDeleter | ||
502 | { | 500 | { | ||
503 | static inline void cleanup(xcb_connection_t *pointer) | 501 | static inline void cleanup(xcb_connection_t *pointer) | ||
504 | { | 502 | { | ||
505 | xcb_disconnect(pointer); | 503 | xcb_disconnect(pointer); | ||
▲ Show 20 Lines • Show All 333 Lines • Show Last 20 Lines |