Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/dbus_interface_test.cpp
Show All 16 Lines | |||||
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | GNU General Public License for more details. | 18 | GNU General Public License for more details. | ||
19 | 19 | | |||
20 | You should have received a copy of the GNU General Public License | 20 | You should have received a copy of the GNU General Public License | ||
21 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 21 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
22 | *********************************************************************/ | 22 | *********************************************************************/ | ||
23 | #include "kwin_wayland_test.h" | 23 | #include "kwin_wayland_test.h" | ||
24 | #include "atoms.h" | 24 | #include "atoms.h" | ||
25 | #include "client.h" | 25 | #include "x11client.h" | ||
26 | #include "deleted.h" | 26 | #include "deleted.h" | ||
27 | #include "platform.h" | 27 | #include "platform.h" | ||
28 | #include "rules.h" | 28 | #include "rules.h" | ||
29 | #include "screens.h" | 29 | #include "screens.h" | ||
30 | #include "xdgshellclient.h" | 30 | #include "xdgshellclient.h" | ||
31 | #include "virtualdesktops.h" | 31 | #include "virtualdesktops.h" | ||
32 | #include "wayland_server.h" | 32 | #include "wayland_server.h" | ||
33 | #include "workspace.h" | 33 | #include "workspace.h" | ||
▲ Show 20 Lines • Show All 236 Lines • ▼ Show 20 Line(s) | 251 | { | |||
270 | winInfo.setDesktopFileName("org.kde.foo"); | 270 | winInfo.setDesktopFileName("org.kde.foo"); | ||
271 | xcb_map_window(c.data(), w); | 271 | xcb_map_window(c.data(), w); | ||
272 | xcb_flush(c.data()); | 272 | xcb_flush(c.data()); | ||
273 | 273 | | |||
274 | // we should get a client for it | 274 | // we should get a client for it | ||
275 | QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); | 275 | QSignalSpy windowCreatedSpy(workspace(), &Workspace::clientAdded); | ||
276 | QVERIFY(windowCreatedSpy.isValid()); | 276 | QVERIFY(windowCreatedSpy.isValid()); | ||
277 | QVERIFY(windowCreatedSpy.wait()); | 277 | QVERIFY(windowCreatedSpy.wait()); | ||
278 | Client *client = windowCreatedSpy.first().first().value<Client*>(); | 278 | X11Client *client = windowCreatedSpy.first().first().value<X11Client *>(); | ||
279 | QVERIFY(client); | 279 | QVERIFY(client); | ||
280 | QCOMPARE(client->window(), w); | 280 | QCOMPARE(client->window(), w); | ||
281 | QCOMPARE(client->clientSize(), windowGeometry.size()); | 281 | QCOMPARE(client->clientSize(), windowGeometry.size()); | ||
282 | 282 | | |||
283 | // let's get the window info | 283 | // let's get the window info | ||
284 | QDBusPendingReply<QVariantMap> reply{getWindowInfo(client->internalId())}; | 284 | QDBusPendingReply<QVariantMap> reply{getWindowInfo(client->internalId())}; | ||
285 | reply.waitForFinished(); | 285 | reply.waitForFinished(); | ||
286 | QVERIFY(reply.isValid()); | 286 | QVERIFY(reply.isValid()); | ||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | |||||
383 | QCOMPARE(verifyProperty(QStringLiteral("maximizeVertical")), false); | 383 | QCOMPARE(verifyProperty(QStringLiteral("maximizeVertical")), false); | ||
384 | QCOMPARE(verifyProperty(QStringLiteral("maximizeHorizontal")), true); | 384 | QCOMPARE(verifyProperty(QStringLiteral("maximizeHorizontal")), true); | ||
385 | 385 | | |||
386 | const auto id = client->internalId(); | 386 | const auto id = client->internalId(); | ||
387 | // destroy the window | 387 | // destroy the window | ||
388 | xcb_unmap_window(c.data(), w); | 388 | xcb_unmap_window(c.data(), w); | ||
389 | xcb_flush(c.data()); | 389 | xcb_flush(c.data()); | ||
390 | 390 | | |||
391 | QSignalSpy windowClosedSpy(client, &Client::windowClosed); | 391 | QSignalSpy windowClosedSpy(client, &X11Client::windowClosed); | ||
392 | QVERIFY(windowClosedSpy.isValid()); | 392 | QVERIFY(windowClosedSpy.isValid()); | ||
393 | QVERIFY(windowClosedSpy.wait()); | 393 | QVERIFY(windowClosedSpy.wait()); | ||
394 | xcb_destroy_window(c.data(), w); | 394 | xcb_destroy_window(c.data(), w); | ||
395 | c.reset(); | 395 | c.reset(); | ||
396 | 396 | | |||
397 | reply = getWindowInfo(id); | 397 | reply = getWindowInfo(id); | ||
398 | reply.waitForFinished(); | 398 | reply.waitForFinished(); | ||
399 | QVERIFY(reply.value().empty()); | 399 | QVERIFY(reply.value().empty()); | ||
400 | } | 400 | } | ||
401 | 401 | | |||
402 | WAYLANDTEST_MAIN(TestDbusInterface) | 402 | WAYLANDTEST_MAIN(TestDbusInterface) | ||
403 | #include "dbus_interface_test.moc" | 403 | #include "dbus_interface_test.moc" |