Changeset View
Changeset View
Standalone View
Standalone View
autotests/ksldtest.cpp
Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Line(s) | 133 | { | |||
---|---|---|---|---|---|
145 | ksld.setGraceTime(-1); | 145 | ksld.setGraceTime(-1); | ||
146 | 146 | | |||
147 | QSignalSpy lockedSpy(&ksld, &ScreenLocker::KSldApp::locked); | 147 | QSignalSpy lockedSpy(&ksld, &ScreenLocker::KSldApp::locked); | ||
148 | QVERIFY(lockedSpy.isValid()); | 148 | QVERIFY(lockedSpy.isValid()); | ||
149 | QSignalSpy unlockedSpy(&ksld, &ScreenLocker::KSldApp::unlocked); | 149 | QSignalSpy unlockedSpy(&ksld, &ScreenLocker::KSldApp::unlocked); | ||
150 | QVERIFY(unlockedSpy.isValid()); | 150 | QVERIFY(unlockedSpy.isValid()); | ||
151 | 151 | | |||
152 | // let's wait quite some time to give the greeter a chance to come up | 152 | // let's wait quite some time to give the greeter a chance to come up | ||
153 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) | | |||
154 | QEXPECT_FAIL("", "Qt::QueuedConnection broken in Qt 5.6", Abort); | | |||
155 | #endif | | |||
156 | QVERIFY(lockedSpy.wait(30000)); | 153 | QVERIFY(lockedSpy.wait(30000)); | ||
157 | QCOMPARE(ksld.lockState(), ScreenLocker::KSldApp::Locked); | 154 | QCOMPARE(ksld.lockState(), ScreenLocker::KSldApp::Locked); | ||
158 | 155 | | |||
159 | // let's simulate unlock by faking input | 156 | // let's simulate unlock by faking input | ||
160 | const QPoint cursorPos = QCursor::pos(); | 157 | const QPoint cursorPos = QCursor::pos(); | ||
161 | xcb_test_fake_input(QX11Info::connection(), XCB_MOTION_NOTIFY, 0, XCB_TIME_CURRENT_TIME, XCB_WINDOW_NONE, cursorPos.x() + 1, cursorPos.y() + 1, 0); | 158 | xcb_test_fake_input(QX11Info::connection(), XCB_MOTION_NOTIFY, 0, XCB_TIME_CURRENT_TIME, XCB_WINDOW_NONE, cursorPos.x() + 1, cursorPos.y() + 1, 0); | ||
162 | xcb_flush(QX11Info::connection()); | 159 | xcb_flush(QX11Info::connection()); | ||
163 | QVERIFY(unlockedSpy.wait()); | 160 | QVERIFY(unlockedSpy.wait()); | ||
Show All 24 Lines |