Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/lockscreen.cpp
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Line(s) | 227 | { | |||
---|---|---|---|---|---|
234 | QSignalSpy leftSpy(pointer.data(), &Pointer::left); | 234 | QSignalSpy leftSpy(pointer.data(), &Pointer::left); | ||
235 | QVERIFY(leftSpy.isValid()); | 235 | QVERIFY(leftSpy.isValid()); | ||
236 | 236 | | |||
237 | AbstractClient *c = showWindow(); | 237 | AbstractClient *c = showWindow(); | ||
238 | QVERIFY(c); | 238 | QVERIFY(c); | ||
239 | 239 | | |||
240 | // first move cursor into the center of the window | 240 | // first move cursor into the center of the window | ||
241 | quint32 timestamp = 1; | 241 | quint32 timestamp = 1; | ||
242 | MOTION(c->geometry().center()); | 242 | MOTION(c->frameGeometry().center()); | ||
243 | QVERIFY(enteredSpy.wait()); | 243 | QVERIFY(enteredSpy.wait()); | ||
244 | 244 | | |||
245 | LOCK | 245 | LOCK | ||
246 | 246 | | |||
247 | QVERIFY(leftSpy.wait()); | 247 | QVERIFY(leftSpy.wait()); | ||
248 | QCOMPARE(leftSpy.count(), 1); | 248 | QCOMPARE(leftSpy.count(), 1); | ||
249 | 249 | | |||
250 | // simulate moving out in and out again | 250 | // simulate moving out in and out again | ||
251 | MOTION(c->geometry().center()); | 251 | MOTION(c->frameGeometry().center()); | ||
252 | MOTION(c->geometry().bottomRight() + QPoint(100, 100)); | 252 | MOTION(c->frameGeometry().bottomRight() + QPoint(100, 100)); | ||
253 | MOTION(c->geometry().bottomRight() + QPoint(100, 100)); | 253 | MOTION(c->frameGeometry().bottomRight() + QPoint(100, 100)); | ||
254 | QVERIFY(!leftSpy.wait()); | 254 | QVERIFY(!leftSpy.wait()); | ||
255 | QCOMPARE(leftSpy.count(), 1); | 255 | QCOMPARE(leftSpy.count(), 1); | ||
256 | QCOMPARE(enteredSpy.count(), 1); | 256 | QCOMPARE(enteredSpy.count(), 1); | ||
257 | 257 | | |||
258 | // go back on the window | 258 | // go back on the window | ||
259 | MOTION(c->geometry().center()); | 259 | MOTION(c->frameGeometry().center()); | ||
260 | // and unlock | 260 | // and unlock | ||
261 | UNLOCK | 261 | UNLOCK | ||
262 | 262 | | |||
263 | QVERIFY(enteredSpy.wait()); | 263 | QVERIFY(enteredSpy.wait()); | ||
264 | QCOMPARE(enteredSpy.count(), 2); | 264 | QCOMPARE(enteredSpy.count(), 2); | ||
265 | // move on the window | 265 | // move on the window | ||
266 | MOTION(c->geometry().center() + QPoint(100, 100)); | 266 | MOTION(c->frameGeometry().center() + QPoint(100, 100)); | ||
267 | QVERIFY(leftSpy.wait()); | 267 | QVERIFY(leftSpy.wait()); | ||
268 | MOTION(c->geometry().center()); | 268 | MOTION(c->frameGeometry().center()); | ||
269 | QVERIFY(enteredSpy.wait()); | 269 | QVERIFY(enteredSpy.wait()); | ||
270 | QCOMPARE(enteredSpy.count(), 3); | 270 | QCOMPARE(enteredSpy.count(), 3); | ||
271 | } | 271 | } | ||
272 | 272 | | |||
273 | void LockScreenTest::testPointerButton() | 273 | void LockScreenTest::testPointerButton() | ||
274 | { | 274 | { | ||
275 | using namespace KWayland::Client; | 275 | using namespace KWayland::Client; | ||
276 | 276 | | |||
277 | QScopedPointer<Pointer> pointer(m_seat->createPointer()); | 277 | QScopedPointer<Pointer> pointer(m_seat->createPointer()); | ||
278 | QVERIFY(!pointer.isNull()); | 278 | QVERIFY(!pointer.isNull()); | ||
279 | QSignalSpy enteredSpy(pointer.data(), &Pointer::entered); | 279 | QSignalSpy enteredSpy(pointer.data(), &Pointer::entered); | ||
280 | QVERIFY(enteredSpy.isValid()); | 280 | QVERIFY(enteredSpy.isValid()); | ||
281 | QSignalSpy buttonChangedSpy(pointer.data(), &Pointer::buttonStateChanged); | 281 | QSignalSpy buttonChangedSpy(pointer.data(), &Pointer::buttonStateChanged); | ||
282 | QVERIFY(buttonChangedSpy.isValid()); | 282 | QVERIFY(buttonChangedSpy.isValid()); | ||
283 | 283 | | |||
284 | AbstractClient *c = showWindow(); | 284 | AbstractClient *c = showWindow(); | ||
285 | QVERIFY(c); | 285 | QVERIFY(c); | ||
286 | 286 | | |||
287 | // first move cursor into the center of the window | 287 | // first move cursor into the center of the window | ||
288 | quint32 timestamp = 1; | 288 | quint32 timestamp = 1; | ||
289 | MOTION(c->geometry().center()); | 289 | MOTION(c->frameGeometry().center()); | ||
290 | QVERIFY(enteredSpy.wait()); | 290 | QVERIFY(enteredSpy.wait()); | ||
291 | // and simulate a click | 291 | // and simulate a click | ||
292 | PRESS; | 292 | PRESS; | ||
293 | QVERIFY(buttonChangedSpy.wait()); | 293 | QVERIFY(buttonChangedSpy.wait()); | ||
294 | RELEASE; | 294 | RELEASE; | ||
295 | QVERIFY(buttonChangedSpy.wait()); | 295 | QVERIFY(buttonChangedSpy.wait()); | ||
296 | 296 | | |||
297 | LOCK | 297 | LOCK | ||
Show All 26 Lines | 317 | { | |||
324 | QSignalSpy enteredSpy(pointer.data(), &Pointer::entered); | 324 | QSignalSpy enteredSpy(pointer.data(), &Pointer::entered); | ||
325 | QVERIFY(enteredSpy.isValid()); | 325 | QVERIFY(enteredSpy.isValid()); | ||
326 | 326 | | |||
327 | AbstractClient *c = showWindow(); | 327 | AbstractClient *c = showWindow(); | ||
328 | QVERIFY(c); | 328 | QVERIFY(c); | ||
329 | 329 | | |||
330 | // first move cursor into the center of the window | 330 | // first move cursor into the center of the window | ||
331 | quint32 timestamp = 1; | 331 | quint32 timestamp = 1; | ||
332 | MOTION(c->geometry().center()); | 332 | MOTION(c->frameGeometry().center()); | ||
333 | QVERIFY(enteredSpy.wait()); | 333 | QVERIFY(enteredSpy.wait()); | ||
334 | // and simulate axis | 334 | // and simulate axis | ||
335 | kwinApp()->platform()->pointerAxisHorizontal(5.0, timestamp++); | 335 | kwinApp()->platform()->pointerAxisHorizontal(5.0, timestamp++); | ||
336 | QVERIFY(axisChangedSpy.wait()); | 336 | QVERIFY(axisChangedSpy.wait()); | ||
337 | 337 | | |||
338 | LOCK | 338 | LOCK | ||
339 | 339 | | |||
340 | // and simulate axis | 340 | // and simulate axis | ||
▲ Show 20 Lines • Show All 428 Lines • Show Last 20 Lines |