Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/lockscreen.cpp
Show All 29 Lines | |||||
30 | #include "shell_client.h" | 30 | #include "shell_client.h" | ||
31 | #include <kwineffects.h> | 31 | #include <kwineffects.h> | ||
32 | 32 | | |||
33 | #include <KWayland/Client/connection_thread.h> | 33 | #include <KWayland/Client/connection_thread.h> | ||
34 | #include <KWayland/Client/compositor.h> | 34 | #include <KWayland/Client/compositor.h> | ||
35 | #include <KWayland/Client/keyboard.h> | 35 | #include <KWayland/Client/keyboard.h> | ||
36 | #include <KWayland/Client/registry.h> | 36 | #include <KWayland/Client/registry.h> | ||
37 | #include <KWayland/Client/pointer.h> | 37 | #include <KWayland/Client/pointer.h> | ||
38 | #include <KWayland/Client/shell.h> | | |||
39 | #include <KWayland/Client/seat.h> | 38 | #include <KWayland/Client/seat.h> | ||
40 | #include <KWayland/Client/shm_pool.h> | 39 | #include <KWayland/Client/shm_pool.h> | ||
41 | #include <KWayland/Client/surface.h> | 40 | #include <KWayland/Client/surface.h> | ||
42 | #include <KWayland/Client/touch.h> | 41 | #include <KWayland/Client/touch.h> | ||
43 | #include <KWayland/Server/seat_interface.h> | 42 | #include <KWayland/Server/seat_interface.h> | ||
44 | 43 | | |||
45 | //screenlocker | 44 | //screenlocker | ||
46 | #include <KScreenLocker/KsldApp> | 45 | #include <KScreenLocker/KsldApp> | ||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Line(s) | 161 | #define VERIFY(statement) \ | |||
163 | if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__))\ | 162 | if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__))\ | ||
164 | return nullptr; | 163 | return nullptr; | ||
165 | #define COMPARE(actual, expected) \ | 164 | #define COMPARE(actual, expected) \ | ||
166 | if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__))\ | 165 | if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__))\ | ||
167 | return nullptr; | 166 | return nullptr; | ||
168 | 167 | | |||
169 | Surface *surface = Test::createSurface(m_compositor); | 168 | Surface *surface = Test::createSurface(m_compositor); | ||
170 | VERIFY(surface); | 169 | VERIFY(surface); | ||
171 | ShellSurface *shellSurface = Test::createShellSurface(surface, surface); | 170 | XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); | ||
172 | VERIFY(shellSurface); | 171 | VERIFY(shellSurface); | ||
173 | // let's render | 172 | // let's render | ||
174 | auto c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | 173 | auto c = Test::renderAndWaitForShown(surface, QSize(100, 50), Qt::blue); | ||
175 | 174 | | |||
176 | VERIFY(c); | 175 | VERIFY(c); | ||
177 | COMPARE(workspace()->activeClient(), c); | 176 | COMPARE(workspace()->activeClient(), c); | ||
178 | 177 | | |||
179 | #undef VERIFY | 178 | #undef VERIFY | ||
Show All 27 Lines | |||||
207 | } | 206 | } | ||
208 | 207 | | |||
209 | void LockScreenTest::init() | 208 | void LockScreenTest::init() | ||
210 | { | 209 | { | ||
211 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat)); | 210 | QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat)); | ||
212 | QVERIFY(Test::waitForWaylandPointer()); | 211 | QVERIFY(Test::waitForWaylandPointer()); | ||
213 | m_connection = Test::waylandConnection(); | 212 | m_connection = Test::waylandConnection(); | ||
214 | m_compositor = Test::waylandCompositor(); | 213 | m_compositor = Test::waylandCompositor(); | ||
215 | m_shell = Test::waylandShell(); | | |||
216 | m_shm = Test::waylandShmPool(); | 214 | m_shm = Test::waylandShmPool(); | ||
217 | m_seat = Test::waylandSeat(); | 215 | m_seat = Test::waylandSeat(); | ||
218 | 216 | | |||
219 | screens()->setCurrent(0); | 217 | screens()->setCurrent(0); | ||
220 | Cursor::setPos(QPoint(640, 512)); | 218 | Cursor::setPos(QPoint(640, 512)); | ||
221 | } | 219 | } | ||
222 | 220 | | |||
223 | void LockScreenTest::cleanup() | 221 | void LockScreenTest::cleanup() | ||
▲ Show 20 Lines • Show All 547 Lines • Show Last 20 Lines |