Changeset View
Changeset View
Standalone View
Standalone View
autotests/client/test_wayland_windowmanagement.cpp
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 50 | private Q_SLOTS: | |||
---|---|---|---|---|---|
62 | void testRequestsBoolean_data(); | 62 | void testRequestsBoolean_data(); | ||
63 | void testRequestsBoolean(); | 63 | void testRequestsBoolean(); | ||
64 | void testShowingDesktop(); | 64 | void testShowingDesktop(); | ||
65 | void testRequestShowingDesktop_data(); | 65 | void testRequestShowingDesktop_data(); | ||
66 | void testRequestShowingDesktop(); | 66 | void testRequestShowingDesktop(); | ||
67 | void testParentWindow(); | 67 | void testParentWindow(); | ||
68 | void testGeometry(); | 68 | void testGeometry(); | ||
69 | void testIcon(); | 69 | void testIcon(); | ||
70 | void testPid(); | ||||
70 | 71 | | |||
71 | void cleanup(); | 72 | void cleanup(); | ||
72 | 73 | | |||
73 | private: | 74 | private: | ||
74 | KWayland::Server::Display *m_display; | 75 | KWayland::Server::Display *m_display; | ||
75 | KWayland::Server::CompositorInterface *m_compositorInterface; | 76 | KWayland::Server::CompositorInterface *m_compositorInterface; | ||
76 | KWayland::Server::PlasmaWindowManagementInterface *m_windowManagementInterface; | 77 | KWayland::Server::PlasmaWindowManagementInterface *m_windowManagementInterface; | ||
77 | KWayland::Server::PlasmaWindowInterface *m_windowInterface; | 78 | KWayland::Server::PlasmaWindowInterface *m_windowInterface; | ||
▲ Show 20 Lines • Show All 498 Lines • ▼ Show 20 Line(s) | 551 | { | |||
576 | m_windowInterface->setIcon(QIcon::fromTheme(QStringLiteral("xorg"))); | 577 | m_windowInterface->setIcon(QIcon::fromTheme(QStringLiteral("xorg"))); | ||
577 | QVERIFY(iconChangedSpy.wait()); | 578 | QVERIFY(iconChangedSpy.wait()); | ||
578 | if (!QIcon::hasThemeIcon(QStringLiteral("xorg"))) { | 579 | if (!QIcon::hasThemeIcon(QStringLiteral("xorg"))) { | ||
579 | QEXPECT_FAIL("", "no icon", Continue); | 580 | QEXPECT_FAIL("", "no icon", Continue); | ||
580 | } | 581 | } | ||
581 | QCOMPARE(m_window->icon().name(), QStringLiteral("xorg")); | 582 | QCOMPARE(m_window->icon().name(), QStringLiteral("xorg")); | ||
582 | } | 583 | } | ||
583 | 584 | | |||
585 | void TestWindowManagement::testPid() | ||||
586 | { | ||||
587 | using namespace KWayland::Client; | ||||
588 | QVERIFY(m_window); | ||||
589 | QVERIFY(m_windowInterface); | ||||
590 | QVERIFY(m_window->pid() == 0); | ||||
591 | QSignalSpy pidChangedSpy(m_window, &PlasmaWindow::pidChanged); | ||||
592 | QVERIFY(pidChangedSpy.isValid()); | ||||
593 | // doing nothing does nothing | ||||
594 | QVERIFY(!pidChangedSpy.wait(10)); | ||||
595 | m_windowInterface->setPid(1984); | ||||
596 | QVERIFY(pidChangedSpy.wait()); | ||||
597 | QVERIFY(m_window->pid() == 1984); | ||||
598 | // no signal when the same value is set twice | ||||
599 | m_windowInterface->setPid(1984); | ||||
600 | QVERIFY(!pidChangedSpy.wait(10)); | ||||
601 | QVERIFY(m_window->pid() == 1984); | ||||
602 | } | ||||
603 | | ||||
584 | QTEST_MAIN(TestWindowManagement) | 604 | QTEST_MAIN(TestWindowManagement) | ||
585 | #include "test_wayland_windowmanagement.moc" | 605 | #include "test_wayland_windowmanagement.moc" |