Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/debug_console_test.cpp
Show All 16 Lines | |||||
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 "debug_console.h" | 21 | #include "debug_console.h" | ||
22 | #include "internal_client.h" | 22 | #include "internal_client.h" | ||
23 | #include "platform.h" | 23 | #include "platform.h" | ||
24 | #include "screens.h" | 24 | #include "screens.h" | ||
25 | #include "shell_client.h" | 25 | #include "xdgshellclient.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/shm_pool.h> | 32 | #include <KWayland/Client/shm_pool.h> | ||
33 | #include <KWayland/Client/surface.h> | 33 | #include <KWayland/Client/surface.h> | ||
Show All 21 Lines | 46 | private Q_SLOTS: | |||
55 | void testInternalWindow(); | 55 | void testInternalWindow(); | ||
56 | void testClosingDebugConsole(); | 56 | void testClosingDebugConsole(); | ||
57 | }; | 57 | }; | ||
58 | 58 | | |||
59 | void DebugConsoleTest::initTestCase() | 59 | void DebugConsoleTest::initTestCase() | ||
60 | { | 60 | { | ||
61 | qRegisterMetaType<KWin::AbstractClient *>(); | 61 | qRegisterMetaType<KWin::AbstractClient *>(); | ||
62 | qRegisterMetaType<KWin::InternalClient *>(); | 62 | qRegisterMetaType<KWin::InternalClient *>(); | ||
63 | qRegisterMetaType<KWin::ShellClient *>(); | 63 | qRegisterMetaType<KWin::XdgShellClient *>(); | ||
64 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 64 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
65 | QVERIFY(workspaceCreatedSpy.isValid()); | 65 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
66 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 66 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
67 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 67 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
68 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | 68 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | ||
69 | 69 | | |||
70 | kwinApp()->start(); | 70 | kwinApp()->start(); | ||
71 | QVERIFY(workspaceCreatedSpy.wait()); | 71 | QVERIFY(workspaceCreatedSpy.wait()); | ||
▲ Show 20 Lines • Show All 316 Lines • ▼ Show 20 Line(s) | 308 | { | |||
388 | QSignalSpy rowsRemovedSpy(&model, &QAbstractItemModel::rowsRemoved); | 388 | QSignalSpy rowsRemovedSpy(&model, &QAbstractItemModel::rowsRemoved); | ||
389 | QVERIFY(rowsRemovedSpy.isValid()); | 389 | QVERIFY(rowsRemovedSpy.isValid()); | ||
390 | 390 | | |||
391 | surface->attachBuffer(Buffer::Ptr()); | 391 | surface->attachBuffer(Buffer::Ptr()); | ||
392 | surface->commit(Surface::CommitFlag::None); | 392 | surface->commit(Surface::CommitFlag::None); | ||
393 | shellSurface.reset(); | 393 | shellSurface.reset(); | ||
394 | Test::flushWaylandConnection(); | 394 | Test::flushWaylandConnection(); | ||
395 | qDebug() << rowsRemovedSpy.count(); | 395 | qDebug() << rowsRemovedSpy.count(); | ||
396 | QEXPECT_FAIL("wlShell", "Deleting a ShellSurface does not result in the server removing the ShellClient", Continue); | 396 | QEXPECT_FAIL("wlShell", "Deleting a ShellSurface does not result in the server removing the XdgShellClient", Continue); | ||
397 | QVERIFY(rowsRemovedSpy.wait(500)); | 397 | QVERIFY(rowsRemovedSpy.wait(500)); | ||
398 | surface.reset(); | 398 | surface.reset(); | ||
399 | 399 | | |||
400 | if (rowsRemovedSpy.isEmpty()) { | 400 | if (rowsRemovedSpy.isEmpty()) { | ||
401 | QVERIFY(rowsRemovedSpy.wait()); | 401 | QVERIFY(rowsRemovedSpy.wait()); | ||
402 | } | 402 | } | ||
403 | QCOMPARE(rowsRemovedSpy.count(), 1); | 403 | QCOMPARE(rowsRemovedSpy.count(), 1); | ||
404 | QCOMPARE(rowsRemovedSpy.first().first().value<QModelIndex>(), waylandTopLevelIndex); | 404 | QCOMPARE(rowsRemovedSpy.first().first().value<QModelIndex>(), waylandTopLevelIndex); | ||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |