From 515903cc3359b8bcd55be2e2977561b51b34e897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 3 Sep 2014 20:02:42 +0200 Subject: [PATCH] [kwin_wayland] Test that Seat gets destroyed when Display terminates --- autotests/wayland_server/test_seat.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/autotests/wayland_server/test_seat.cpp b/autotests/wayland_server/test_seat.cpp index d5c6bb85cf..e37ce22f37 100644 --- a/autotests/wayland_server/test_seat.cpp +++ b/autotests/wayland_server/test_seat.cpp @@ -34,6 +34,7 @@ private Q_SLOTS: void testName(); void testPointerButton(); void testPointerPos(); + void testDestroyThroughTerminate(); }; static const QString s_socketName = QStringLiteral("kwin-wayland-server-seat-test-0"); @@ -157,5 +158,17 @@ void TestWaylandServerSeat::testPointerPos() QCOMPARE(posSpy.count(), 1); } +void TestWaylandServerSeat::testDestroyThroughTerminate() +{ + Display display; + display.setSocketName(s_socketName); + display.start(); + SeatInterface *seat = display.createSeat(); + QSignalSpy destroyedSpy(seat, SIGNAL(destroyed(QObject*))); + QVERIFY(destroyedSpy.isValid()); + display.terminate(); + QVERIFY(!destroyedSpy.isEmpty()); +} + QTEST_MAIN(TestWaylandServerSeat) #include "test_seat.moc"