Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/xclipboardsync_test.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
51 | { | 51 | { | ||
52 | qRegisterMetaType<KWin::ShellClient*>(); | 52 | qRegisterMetaType<KWin::ShellClient*>(); | ||
53 | qRegisterMetaType<KWin::AbstractClient*>(); | 53 | qRegisterMetaType<KWin::AbstractClient*>(); | ||
54 | qRegisterMetaType<QProcess::ExitStatus>(); | 54 | qRegisterMetaType<QProcess::ExitStatus>(); | ||
55 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | 55 | QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); | ||
56 | QVERIFY(workspaceCreatedSpy.isValid()); | 56 | QVERIFY(workspaceCreatedSpy.isValid()); | ||
57 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | 57 | kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024)); | ||
58 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | 58 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2)); | ||
59 | QSignalSpy clipboardSyncDevicedCreated{waylandServer(), &WaylandServer::xclipboardSyncDataDeviceCreated}; | ||||
60 | QVERIFY(clipboardSyncDevicedCreated.isValid()); | ||||
59 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | 61 | QVERIFY(waylandServer()->init(s_socketName.toLocal8Bit())); | ||
60 | 62 | | |||
61 | kwinApp()->start(); | 63 | kwinApp()->start(); | ||
62 | QVERIFY(workspaceCreatedSpy.wait()); | 64 | QVERIFY(workspaceCreatedSpy.wait()); | ||
63 | QCOMPARE(screens()->count(), 2); | 65 | QCOMPARE(screens()->count(), 2); | ||
64 | QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); | 66 | QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); | ||
65 | QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); | 67 | QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); | ||
66 | waylandServer()->initWorkspace(); | 68 | waylandServer()->initWorkspace(); | ||
67 | // wait till the xclipboard sync data device is created | 69 | // wait till the xclipboard sync data device is created | ||
68 | while (waylandServer()->xclipboardSyncDataDevice().isNull()) { | 70 | if (clipboardSyncDevicedCreated.empty()) { | ||
69 | QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents); | 71 | QVERIFY(clipboardSyncDevicedCreated.wait()); | ||
70 | } | 72 | } | ||
71 | QVERIFY(!waylandServer()->xclipboardSyncDataDevice().isNull()); | 73 | QVERIFY(!waylandServer()->xclipboardSyncDataDevice().isNull()); | ||
72 | } | 74 | } | ||
73 | 75 | | |||
74 | void XClipboardSyncTest::cleanup() | 76 | void XClipboardSyncTest::cleanup() | ||
75 | { | 77 | { | ||
76 | if (m_copyProcess) { | 78 | if (m_copyProcess) { | ||
77 | m_copyProcess->terminate(); | 79 | m_copyProcess->terminate(); | ||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |