Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/shell_client_test.cpp
Show All 14 Lines | |||||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
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 "cursor.h" | 21 | #include "cursor.h" | ||
22 | #include "effects.h" | 22 | #include "effects.h" | ||
23 | #include "deleted.h" | ||||
23 | #include "platform.h" | 24 | #include "platform.h" | ||
24 | #include "shell_client.h" | 25 | #include "shell_client.h" | ||
25 | #include "screens.h" | 26 | #include "screens.h" | ||
26 | #include "wayland_server.h" | 27 | #include "wayland_server.h" | ||
27 | #include "workspace.h" | 28 | #include "workspace.h" | ||
28 | 29 | | |||
29 | #include <QDBusConnection> | 30 | #include <QDBusConnection> | ||
30 | 31 | | |||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Line(s) | 142 | { | |||
169 | QVERIFY(client->isMaximizable()); | 170 | QVERIFY(client->isMaximizable()); | ||
170 | QVERIFY(client->isMovable()); | 171 | QVERIFY(client->isMovable()); | ||
171 | QVERIFY(client->isMovableAcrossScreens()); | 172 | QVERIFY(client->isMovableAcrossScreens()); | ||
172 | QVERIFY(client->isResizable()); | 173 | QVERIFY(client->isResizable()); | ||
173 | QVERIFY(client->property("maximizable").toBool()); | 174 | QVERIFY(client->property("maximizable").toBool()); | ||
174 | QVERIFY(client->property("moveable").toBool()); | 175 | QVERIFY(client->property("moveable").toBool()); | ||
175 | QVERIFY(client->property("moveableAcrossScreens").toBool()); | 176 | QVERIFY(client->property("moveableAcrossScreens").toBool()); | ||
176 | QVERIFY(client->property("resizeable").toBool()); | 177 | QVERIFY(client->property("resizeable").toBool()); | ||
178 | QCOMPARE(client->internalId().isNull(), false); | ||||
179 | const auto uuid = client->internalId(); | ||||
180 | QUuid deletedUuid; | ||||
181 | QCOMPARE(deletedUuid.isNull(), true); | ||||
182 | | ||||
183 | connect(client, &ShellClient::windowClosed, this, [&deletedUuid] (Toplevel *, Deleted *d) { deletedUuid = d->internalId(); }); | ||||
177 | 184 | | |||
178 | // now unmap | 185 | // now unmap | ||
179 | QSignalSpy hiddenSpy(client, &ShellClient::windowHidden); | 186 | QSignalSpy hiddenSpy(client, &ShellClient::windowHidden); | ||
180 | QVERIFY(hiddenSpy.isValid()); | 187 | QVERIFY(hiddenSpy.isValid()); | ||
181 | QSignalSpy windowClosedSpy(client, &ShellClient::windowClosed); | 188 | QSignalSpy windowClosedSpy(client, &ShellClient::windowClosed); | ||
182 | QVERIFY(windowClosedSpy.isValid()); | 189 | QVERIFY(windowClosedSpy.isValid()); | ||
183 | surface->attachBuffer(Buffer::Ptr()); | 190 | surface->attachBuffer(Buffer::Ptr()); | ||
184 | surface->commit(Surface::CommitFlag::None); | 191 | surface->commit(Surface::CommitFlag::None); | ||
Show All 22 Lines | |||||
207 | 214 | | |||
208 | // let's unmap again | 215 | // let's unmap again | ||
209 | surface->attachBuffer(Buffer::Ptr()); | 216 | surface->attachBuffer(Buffer::Ptr()); | ||
210 | surface->commit(Surface::CommitFlag::None); | 217 | surface->commit(Surface::CommitFlag::None); | ||
211 | QVERIFY(hiddenSpy.wait()); | 218 | QVERIFY(hiddenSpy.wait()); | ||
212 | QCOMPARE(hiddenSpy.count(), 2); | 219 | QCOMPARE(hiddenSpy.count(), 2); | ||
213 | QCOMPARE(client->readyForPainting(), true); | 220 | QCOMPARE(client->readyForPainting(), true); | ||
214 | QCOMPARE(client->isHiddenInternal(), true); | 221 | QCOMPARE(client->isHiddenInternal(), true); | ||
222 | QCOMPARE(client->internalId(), uuid); | ||||
215 | QVERIFY(windowClosedSpy.isEmpty()); | 223 | QVERIFY(windowClosedSpy.isEmpty()); | ||
216 | QCOMPARE(effectsWindowHiddenSpy.count(), 2); | 224 | QCOMPARE(effectsWindowHiddenSpy.count(), 2); | ||
217 | QCOMPARE(effectsWindowHiddenSpy.last().first().value<EffectWindow*>(), client->effectWindow()); | 225 | QCOMPARE(effectsWindowHiddenSpy.last().first().value<EffectWindow*>(), client->effectWindow()); | ||
218 | 226 | | |||
219 | shellSurface.reset(); | 227 | shellSurface.reset(); | ||
220 | surface.reset(); | 228 | surface.reset(); | ||
221 | QVERIFY(windowClosedSpy.wait()); | 229 | QVERIFY(windowClosedSpy.wait()); | ||
222 | QCOMPARE(windowClosedSpy.count(), 1); | 230 | QCOMPARE(windowClosedSpy.count(), 1); | ||
223 | QCOMPARE(effectsWindowHiddenSpy.count(), 2); | 231 | QCOMPARE(effectsWindowHiddenSpy.count(), 2); | ||
232 | QCOMPARE(deletedUuid.isNull(), false); | ||||
233 | QCOMPARE(deletedUuid, uuid); | ||||
224 | } | 234 | } | ||
225 | 235 | | |||
226 | void TestShellClient::testDesktopPresenceChanged() | 236 | void TestShellClient::testDesktopPresenceChanged() | ||
227 | { | 237 | { | ||
228 | // this test verifies that the desktop presence changed signals are properly emitted | 238 | // this test verifies that the desktop presence changed signals are properly emitted | ||
229 | QScopedPointer<Surface> surface(Test::createSurface()); | 239 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
230 | QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data())); | 240 | QScopedPointer<ShellSurface> shellSurface(Test::createShellSurface(surface.data())); | ||
231 | auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 241 | auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
▲ Show 20 Lines • Show All 846 Lines • Show Last 20 Lines |