Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/effects/minimize_animation_test.cpp
Show All 20 Lines | |||||
21 | #include "kwin_wayland_test.h" | 21 | #include "kwin_wayland_test.h" | ||
22 | 22 | | |||
23 | #include "abstract_client.h" | 23 | #include "abstract_client.h" | ||
24 | #include "composite.h" | 24 | #include "composite.h" | ||
25 | #include "effectloader.h" | 25 | #include "effectloader.h" | ||
26 | #include "effects.h" | 26 | #include "effects.h" | ||
27 | #include "platform.h" | 27 | #include "platform.h" | ||
28 | #include "scene.h" | 28 | #include "scene.h" | ||
29 | #include "shell_client.h" | 29 | #include "xdgshellclient.h" | ||
30 | #include "wayland_server.h" | 30 | #include "wayland_server.h" | ||
31 | #include "workspace.h" | 31 | #include "workspace.h" | ||
32 | 32 | | |||
33 | #include "effect_builtins.h" | 33 | #include "effect_builtins.h" | ||
34 | 34 | | |||
35 | #include <KWayland/Client/plasmashell.h> | 35 | #include <KWayland/Client/plasmashell.h> | ||
36 | #include <KWayland/Client/plasmawindowmanagement.h> | 36 | #include <KWayland/Client/plasmawindowmanagement.h> | ||
37 | #include <KWayland/Client/surface.h> | 37 | #include <KWayland/Client/surface.h> | ||
Show All 16 Lines | 48 | private Q_SLOTS: | |||
54 | void testMinimizeUnminimize(); | 54 | void testMinimizeUnminimize(); | ||
55 | }; | 55 | }; | ||
56 | 56 | | |||
57 | void MinimizeAnimationTest::initTestCase() | 57 | void MinimizeAnimationTest::initTestCase() | ||
58 | { | 58 | { | ||
59 | qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); | 59 | qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); | ||
60 | 60 | | |||
61 | qRegisterMetaType<KWin::AbstractClient *>(); | 61 | qRegisterMetaType<KWin::AbstractClient *>(); | ||
62 | qRegisterMetaType<KWin::ShellClient *>(); | 62 | qRegisterMetaType<KWin::XdgShellClient *>(); | ||
63 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 63 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
64 | QVERIFY(workspaceCreatedSpy.isValid()); | 64 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
65 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 65 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
66 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 66 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
67 | 67 | | |||
68 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | 68 | auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); | ||
69 | KConfigGroup plugins(config, QStringLiteral("Plugins")); | 69 | KConfigGroup plugins(config, QStringLiteral("Plugins")); | ||
70 | ScriptedEffectLoader loader; | 70 | ScriptedEffectLoader loader; | ||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 117 | { | |||
129 | QVERIFY(!panelSurface.isNull()); | 129 | QVERIFY(!panelSurface.isNull()); | ||
130 | QScopedPointer<XdgShellSurface> panelShellSurface(Test::createXdgShellStableSurface(panelSurface.data())); | 130 | QScopedPointer<XdgShellSurface> panelShellSurface(Test::createXdgShellStableSurface(panelSurface.data())); | ||
131 | QVERIFY(!panelShellSurface.isNull()); | 131 | QVERIFY(!panelShellSurface.isNull()); | ||
132 | QScopedPointer<PlasmaShellSurface> plasmaPanelShellSurface(Test::waylandPlasmaShell()->createSurface(panelSurface.data())); | 132 | QScopedPointer<PlasmaShellSurface> plasmaPanelShellSurface(Test::waylandPlasmaShell()->createSurface(panelSurface.data())); | ||
133 | QVERIFY(!plasmaPanelShellSurface.isNull()); | 133 | QVERIFY(!plasmaPanelShellSurface.isNull()); | ||
134 | plasmaPanelShellSurface->setRole(PlasmaShellSurface::Role::Panel); | 134 | plasmaPanelShellSurface->setRole(PlasmaShellSurface::Role::Panel); | ||
135 | plasmaPanelShellSurface->setPosition(panelRect.topLeft()); | 135 | plasmaPanelShellSurface->setPosition(panelRect.topLeft()); | ||
136 | plasmaPanelShellSurface->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AlwaysVisible); | 136 | plasmaPanelShellSurface->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AlwaysVisible); | ||
137 | ShellClient *panel = Test::renderAndWaitForShown(panelSurface.data(), panelRect.size(), Qt::blue); | 137 | XdgShellClient *panel = Test::renderAndWaitForShown(panelSurface.data(), panelRect.size(), Qt::blue); | ||
138 | QVERIFY(panel); | 138 | QVERIFY(panel); | ||
139 | QVERIFY(panel->isDock()); | 139 | QVERIFY(panel->isDock()); | ||
140 | QCOMPARE(panel->geometry(), panelRect); | 140 | QCOMPARE(panel->geometry(), panelRect); | ||
141 | QVERIFY(plasmaWindowCreatedSpy.wait()); | 141 | QVERIFY(plasmaWindowCreatedSpy.wait()); | ||
142 | QCOMPARE(plasmaWindowCreatedSpy.count(), 1); | 142 | QCOMPARE(plasmaWindowCreatedSpy.count(), 1); | ||
143 | 143 | | |||
144 | // Create the test client. | 144 | // Create the test client. | ||
145 | QScopedPointer<Surface> surface(Test::createSurface()); | 145 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
146 | QVERIFY(!surface.isNull()); | 146 | QVERIFY(!surface.isNull()); | ||
147 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 147 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
148 | QVERIFY(!shellSurface.isNull()); | 148 | QVERIFY(!shellSurface.isNull()); | ||
149 | ShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::red); | 149 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::red); | ||
150 | QVERIFY(client); | 150 | QVERIFY(client); | ||
151 | QVERIFY(plasmaWindowCreatedSpy.wait()); | 151 | QVERIFY(plasmaWindowCreatedSpy.wait()); | ||
152 | QCOMPARE(plasmaWindowCreatedSpy.count(), 2); | 152 | QCOMPARE(plasmaWindowCreatedSpy.count(), 2); | ||
153 | 153 | | |||
154 | // We have to set the minimized geometry because the squash effect needs it, | 154 | // We have to set the minimized geometry because the squash effect needs it, | ||
155 | // otherwise it won't start animation. | 155 | // otherwise it won't start animation. | ||
156 | auto window = plasmaWindowCreatedSpy.last().first().value<PlasmaWindow *>(); | 156 | auto window = plasmaWindowCreatedSpy.last().first().value<PlasmaWindow *>(); | ||
157 | QVERIFY(window); | 157 | QVERIFY(window); | ||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |