Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/debug_console_test.cpp
Show All 23 Lines | |||||
24 | #include "screens.h" | 24 | #include "screens.h" | ||
25 | #include "shell_client.h" | 25 | #include "shell_client.h" | ||
26 | #include "wayland_server.h" | 26 | #include "wayland_server.h" | ||
27 | #include "workspace.h" | 27 | #include "workspace.h" | ||
28 | #include "xcbutils.h" | 28 | #include "xcbutils.h" | ||
29 | 29 | | |||
30 | #include <KWayland/Client/connection_thread.h> | 30 | #include <KWayland/Client/connection_thread.h> | ||
31 | #include <KWayland/Client/compositor.h> | 31 | #include <KWayland/Client/compositor.h> | ||
32 | #include <KWayland/Client/shell.h> | | |||
33 | #include <KWayland/Client/shm_pool.h> | 32 | #include <KWayland/Client/shm_pool.h> | ||
34 | #include <KWayland/Client/surface.h> | 33 | #include <KWayland/Client/surface.h> | ||
35 | 34 | | |||
36 | #include <QPainter> | 35 | #include <QPainter> | ||
37 | #include <QRasterWindow> | 36 | #include <QRasterWindow> | ||
38 | 37 | | |||
39 | namespace KWin | 38 | namespace KWin | ||
40 | { | 39 | { | ||
▲ Show 20 Lines • Show All 253 Lines • ▼ Show 20 Line(s) | 211 | { | |||
294 | 293 | | |||
295 | // the child should be gone again | 294 | // the child should be gone again | ||
296 | QVERIFY(!model.hasChildren(unmanagedTopLevelIndex)); | 295 | QVERIFY(!model.hasChildren(unmanagedTopLevelIndex)); | ||
297 | QVERIFY(!model2.hasChildren(model2.index(1, 0, QModelIndex()))); | 296 | QVERIFY(!model2.hasChildren(model2.index(1, 0, QModelIndex()))); | ||
298 | } | 297 | } | ||
299 | 298 | | |||
300 | void DebugConsoleTest::testWaylandClient_data() | 299 | void DebugConsoleTest::testWaylandClient_data() | ||
301 | { | 300 | { | ||
302 | QTest::addColumn<Test::ShellSurfaceType>("type"); | 301 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); | ||
303 | 302 | | |||
304 | QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell; | 303 | QTest::newRow("xdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5; | ||
305 | QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5; | 304 | QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6; | ||
305 | QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; | ||||
306 | } | 306 | } | ||
307 | 307 | | |||
308 | void DebugConsoleTest::testWaylandClient() | 308 | void DebugConsoleTest::testWaylandClient() | ||
309 | { | 309 | { | ||
310 | DebugConsoleModel model; | 310 | DebugConsoleModel model; | ||
311 | QModelIndex waylandTopLevelIndex = model.index(2, 0, QModelIndex()); | 311 | QModelIndex waylandTopLevelIndex = model.index(2, 0, QModelIndex()); | ||
312 | QVERIFY(waylandTopLevelIndex.isValid()); | 312 | QVERIFY(waylandTopLevelIndex.isValid()); | ||
313 | 313 | | |||
Show All 12 Lines | |||||
326 | 326 | | |||
327 | // create our connection | 327 | // create our connection | ||
328 | QVERIFY(Test::setupWaylandConnection()); | 328 | QVERIFY(Test::setupWaylandConnection()); | ||
329 | 329 | | |||
330 | // create the Surface and ShellSurface | 330 | // create the Surface and ShellSurface | ||
331 | using namespace KWayland::Client; | 331 | using namespace KWayland::Client; | ||
332 | QScopedPointer<Surface> surface(Test::createSurface()); | 332 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
333 | QVERIFY(surface->isValid()); | 333 | QVERIFY(surface->isValid()); | ||
334 | QFETCH(Test::ShellSurfaceType, type); | 334 | QFETCH(Test::XdgShellSurfaceType, type); | ||
335 | QScopedPointer<QObject> shellSurface(Test::createShellSurface(type, surface.data())); | 335 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellSurface(type, surface.data())); | ||
336 | QVERIFY(!shellSurface.isNull()); | 336 | QVERIFY(!shellSurface.isNull()); | ||
337 | Test::render(surface.data(), QSize(10, 10), Qt::red); | 337 | Test::render(surface.data(), QSize(10, 10), Qt::red); | ||
338 | 338 | | |||
339 | // now we have the window, it should be added to our model | 339 | // now we have the window, it should be added to our model | ||
340 | QVERIFY(rowsInsertedSpy.wait()); | 340 | QVERIFY(rowsInsertedSpy.wait()); | ||
341 | QCOMPARE(rowsInsertedSpy.count(), 1); | 341 | QCOMPARE(rowsInsertedSpy.count(), 1); | ||
342 | 342 | | |||
343 | QVERIFY(model.hasChildren(waylandTopLevelIndex)); | 343 | QVERIFY(model.hasChildren(waylandTopLevelIndex)); | ||
▲ Show 20 Lines • Show All 190 Lines • Show Last 20 Lines |