Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/dont_crash_no_border.cpp
Show All 26 Lines | |||||
27 | #include "screenedge.h" | 27 | #include "screenedge.h" | ||
28 | #include "screens.h" | 28 | #include "screens.h" | ||
29 | #include "wayland_server.h" | 29 | #include "wayland_server.h" | ||
30 | #include "workspace.h" | 30 | #include "workspace.h" | ||
31 | #include "shell_client.h" | 31 | #include "shell_client.h" | ||
32 | #include <kwineffects.h> | 32 | #include <kwineffects.h> | ||
33 | 33 | | |||
34 | #include <KWayland/Client/server_decoration.h> | 34 | #include <KWayland/Client/server_decoration.h> | ||
35 | #include <KWayland/Client/shell.h> | | |||
36 | #include <KWayland/Client/surface.h> | 35 | #include <KWayland/Client/surface.h> | ||
37 | 36 | | |||
38 | #include <KDecoration2/Decoration> | 37 | #include <KDecoration2/Decoration> | ||
39 | 38 | | |||
40 | #include <linux/input.h> | 39 | #include <linux/input.h> | ||
41 | 40 | | |||
42 | namespace KWin | 41 | namespace KWin | ||
43 | { | 42 | { | ||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | |||||
95 | 94 | | |||
96 | void DontCrashNoBorder::cleanup() | 95 | void DontCrashNoBorder::cleanup() | ||
97 | { | 96 | { | ||
98 | Test::destroyWaylandConnection(); | 97 | Test::destroyWaylandConnection(); | ||
99 | } | 98 | } | ||
100 | 99 | | |||
101 | void DontCrashNoBorder::testCreateWindow_data() | 100 | void DontCrashNoBorder::testCreateWindow_data() | ||
102 | { | 101 | { | ||
103 | QTest::addColumn<Test::ShellSurfaceType>("type"); | 102 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); | ||
104 | 103 | | |||
105 | QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell; | 104 | QTest::newRow("xdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5; | ||
106 | QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5; | 105 | QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6; | ||
107 | QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6; | 106 | QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; | ||
108 | QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable; | | |||
109 | } | 107 | } | ||
110 | 108 | | |||
111 | void DontCrashNoBorder::testCreateWindow() | 109 | void DontCrashNoBorder::testCreateWindow() | ||
112 | { | 110 | { | ||
113 | // create a window and ensure that this doesn't crash | 111 | // create a window and ensure that this doesn't crash | ||
114 | using namespace KWayland::Client; | 112 | using namespace KWayland::Client; | ||
115 | 113 | | |||
116 | QScopedPointer<Surface> surface(Test::createSurface()); | 114 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
117 | QVERIFY(!surface.isNull()); | 115 | QVERIFY(!surface.isNull()); | ||
118 | QFETCH(Test::ShellSurfaceType, type); | 116 | QFETCH(Test::XdgShellSurfaceType, type); | ||
119 | QScopedPointer<QObject> shellSurface(Test::createShellSurface(type, surface.data())); | 117 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellSurface(type, surface.data())); | ||
120 | QVERIFY(shellSurface); | 118 | QVERIFY(shellSurface); | ||
121 | QScopedPointer<ServerSideDecoration> deco(Test::waylandServerSideDecoration()->create(surface.data())); | 119 | QScopedPointer<ServerSideDecoration> deco(Test::waylandServerSideDecoration()->create(surface.data())); | ||
122 | QSignalSpy decoSpy(deco.data(), &ServerSideDecoration::modeChanged); | 120 | QSignalSpy decoSpy(deco.data(), &ServerSideDecoration::modeChanged); | ||
123 | QVERIFY(decoSpy.isValid()); | 121 | QVERIFY(decoSpy.isValid()); | ||
124 | QVERIFY(decoSpy.wait()); | 122 | QVERIFY(decoSpy.wait()); | ||
125 | deco->requestMode(ServerSideDecoration::Mode::Server); | 123 | deco->requestMode(ServerSideDecoration::Mode::Server); | ||
126 | QVERIFY(decoSpy.wait()); | 124 | QVERIFY(decoSpy.wait()); | ||
127 | QCOMPARE(deco->mode(), ServerSideDecoration::Mode::Server); | 125 | QCOMPARE(deco->mode(), ServerSideDecoration::Mode::Server); | ||
Show All 11 Lines |