Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/plasma_surface_test.cpp
Show All 14 Lines | |||||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "kwin_wayland_test.h" | 20 | #include "kwin_wayland_test.h" | ||
21 | #include "platform.h" | 21 | #include "platform.h" | ||
22 | #include "cursor.h" | 22 | #include "cursor.h" | ||
23 | #include "shell_client.h" | 23 | #include "xdgshellclient.h" | ||
24 | #include "screens.h" | 24 | #include "screens.h" | ||
25 | #include "wayland_server.h" | 25 | #include "wayland_server.h" | ||
26 | #include "workspace.h" | 26 | #include "workspace.h" | ||
27 | #include <KWayland/Client/connection_thread.h> | 27 | #include <KWayland/Client/connection_thread.h> | ||
28 | #include <KWayland/Client/compositor.h> | 28 | #include <KWayland/Client/compositor.h> | ||
29 | #include <KWayland/Client/event_queue.h> | 29 | #include <KWayland/Client/event_queue.h> | ||
30 | #include <KWayland/Client/plasmashell.h> | 30 | #include <KWayland/Client/plasmashell.h> | ||
31 | #include <KWayland/Client/registry.h> | 31 | #include <KWayland/Client/registry.h> | ||
Show All 34 Lines | |||||
66 | private: | 66 | private: | ||
67 | KWayland::Client::Compositor *m_compositor = nullptr; | 67 | KWayland::Client::Compositor *m_compositor = nullptr; | ||
68 | Shell *m_shell = nullptr; | 68 | Shell *m_shell = nullptr; | ||
69 | PlasmaShell *m_plasmaShell = nullptr; | 69 | PlasmaShell *m_plasmaShell = nullptr; | ||
70 | }; | 70 | }; | ||
71 | 71 | | |||
72 | void PlasmaSurfaceTest::initTestCase() | 72 | void PlasmaSurfaceTest::initTestCase() | ||
73 | { | 73 | { | ||
74 | qRegisterMetaType<KWin::ShellClient*>(); | 74 | qRegisterMetaType<KWin::XdgShellClient *>(); | ||
75 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 75 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
76 | QVERIFY(workspaceCreatedSpy.isValid()); | 76 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
77 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 77 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
78 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 78 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
79 | kwinApp()->start(); | 79 | kwinApp()->start(); | ||
80 | QVERIFY(workspaceCreatedSpy.wait()); | 80 | QVERIFY(workspaceCreatedSpy.wait()); | ||
81 | } | 81 | } | ||
82 | 82 | | |||
Show All 22 Lines | 98 | { | |||
105 | QTest::newRow("Normal") << PlasmaShellSurface::Role::Normal << false; | 105 | QTest::newRow("Normal") << PlasmaShellSurface::Role::Normal << false; | ||
106 | QTest::newRow("Notification") << PlasmaShellSurface::Role::Notification << true; | 106 | QTest::newRow("Notification") << PlasmaShellSurface::Role::Notification << true; | ||
107 | QTest::newRow("ToolTip") << PlasmaShellSurface::Role::ToolTip << true; | 107 | QTest::newRow("ToolTip") << PlasmaShellSurface::Role::ToolTip << true; | ||
108 | QTest::newRow("CriticalNotification") << PlasmaShellSurface::Role::CriticalNotification << true; | 108 | QTest::newRow("CriticalNotification") << PlasmaShellSurface::Role::CriticalNotification << true; | ||
109 | } | 109 | } | ||
110 | 110 | | |||
111 | void PlasmaSurfaceTest::testRoleOnAllDesktops() | 111 | void PlasmaSurfaceTest::testRoleOnAllDesktops() | ||
112 | { | 112 | { | ||
113 | // this test verifies that a ShellClient is set on all desktops when the role changes | 113 | // this test verifies that a XdgShellClient is set on all desktops when the role changes | ||
114 | QScopedPointer<Surface> surface(Test::createSurface()); | 114 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
115 | QVERIFY(!surface.isNull()); | 115 | QVERIFY(!surface.isNull()); | ||
116 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 116 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
117 | QVERIFY(!shellSurface.isNull()); | 117 | QVERIFY(!shellSurface.isNull()); | ||
118 | QScopedPointer<PlasmaShellSurface> plasmaSurface(m_plasmaShell->createSurface(surface.data())); | 118 | QScopedPointer<PlasmaShellSurface> plasmaSurface(m_plasmaShell->createSurface(surface.data())); | ||
119 | QVERIFY(!plasmaSurface.isNull()); | 119 | QVERIFY(!plasmaSurface.isNull()); | ||
120 | 120 | | |||
121 | // now render to map the window | 121 | // now render to map the window | ||
▲ Show 20 Lines • Show All 319 Lines • Show Last 20 Lines |