Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/dont_crash_empty_deco.cpp
Show All 21 Lines | |||||
22 | #include "x11client.h" | 22 | #include "x11client.h" | ||
23 | #include "composite.h" | 23 | #include "composite.h" | ||
24 | #include "cursor.h" | 24 | #include "cursor.h" | ||
25 | #include "scene.h" | 25 | #include "scene.h" | ||
26 | #include "screenedge.h" | 26 | #include "screenedge.h" | ||
27 | #include "screens.h" | 27 | #include "screens.h" | ||
28 | #include "wayland_server.h" | 28 | #include "wayland_server.h" | ||
29 | #include "workspace.h" | 29 | #include "workspace.h" | ||
30 | #include "xdgshellclient.h" | | |||
31 | #include <kwineffects.h> | 30 | #include <kwineffects.h> | ||
32 | 31 | | |||
33 | #include <KDecoration2/Decoration> | 32 | #include <KDecoration2/Decoration> | ||
34 | 33 | | |||
35 | #include <linux/input.h> | 34 | #include <linux/input.h> | ||
36 | 35 | | |||
37 | namespace KWin | 36 | namespace KWin | ||
38 | { | 37 | { | ||
39 | 38 | | |||
40 | static const QString s_socketName = QStringLiteral("wayland_test_kwin_dont_crash_empty_decoration-0"); | 39 | static const QString s_socketName = QStringLiteral("wayland_test_kwin_dont_crash_empty_decoration-0"); | ||
41 | 40 | | |||
42 | class DontCrashEmptyDecorationTest : public QObject | 41 | class DontCrashEmptyDecorationTest : public QObject | ||
43 | { | 42 | { | ||
44 | Q_OBJECT | 43 | Q_OBJECT | ||
45 | private Q_SLOTS: | 44 | private Q_SLOTS: | ||
46 | void initTestCase(); | 45 | void initTestCase(); | ||
47 | void init(); | 46 | void init(); | ||
48 | void testBug361551(); | 47 | void testBug361551(); | ||
49 | }; | 48 | }; | ||
50 | 49 | | |||
51 | void DontCrashEmptyDecorationTest::initTestCase() | 50 | void DontCrashEmptyDecorationTest::initTestCase() | ||
52 | { | 51 | { | ||
53 | qRegisterMetaType<KWin::XdgShellClient *>(); | | |||
54 | qRegisterMetaType<KWin::AbstractClient*>(); | 52 | qRegisterMetaType<KWin::AbstractClient*>(); | ||
55 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 53 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
56 | QVERIFY(workspaceCreatedSpy.isValid()); | 54 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
57 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 55 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
58 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 56 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
59 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | 57 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | ||
60 | 58 | | |||
61 | // this test needs to enforce OpenGL compositing to get into the crashy condition | 59 | // this test needs to enforce OpenGL compositing to get into the crashy condition | ||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |