Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/pointer_constraints_test.cpp
Show First 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | 111 | { | |||
---|---|---|---|---|---|
113 | QTest::addColumn<PointerFunc>("positionFunction"); | 113 | QTest::addColumn<PointerFunc>("positionFunction"); | ||
114 | QTest::addColumn<int>("xOffset"); | 114 | QTest::addColumn<int>("xOffset"); | ||
115 | QTest::addColumn<int>("yOffset"); | 115 | QTest::addColumn<int>("yOffset"); | ||
116 | PointerFunc bottomLeft = &QRect::bottomLeft; | 116 | PointerFunc bottomLeft = &QRect::bottomLeft; | ||
117 | PointerFunc bottomRight = &QRect::bottomRight; | 117 | PointerFunc bottomRight = &QRect::bottomRight; | ||
118 | PointerFunc topRight = &QRect::topRight; | 118 | PointerFunc topRight = &QRect::topRight; | ||
119 | PointerFunc topLeft = &QRect::topLeft; | 119 | PointerFunc topLeft = &QRect::topLeft; | ||
120 | 120 | | |||
121 | QTest::newRow("XdgShellV6 - bottomLeft") << Test::XdgShellSurfaceType::XdgShellV6 << bottomLeft << -1 << 1; | | |||
122 | QTest::newRow("XdgShellV6 - bottomRight") << Test::XdgShellSurfaceType::XdgShellV6 << bottomRight << 1 << 1; | | |||
123 | QTest::newRow("XdgShellV6 - topLeft") << Test::XdgShellSurfaceType::XdgShellV6 << topLeft << -1 << -1; | | |||
124 | QTest::newRow("XdgShellV6 - topRight") << Test::XdgShellSurfaceType::XdgShellV6 << topRight << 1 << -1; | | |||
125 | QTest::newRow("XdgWmBase - bottomLeft") << Test::XdgShellSurfaceType::XdgShellStable << bottomLeft << -1 << 1; | 121 | QTest::newRow("XdgWmBase - bottomLeft") << Test::XdgShellSurfaceType::XdgShellStable << bottomLeft << -1 << 1; | ||
126 | QTest::newRow("XdgWmBase - bottomRight") << Test::XdgShellSurfaceType::XdgShellStable << bottomRight << 1 << 1; | 122 | QTest::newRow("XdgWmBase - bottomRight") << Test::XdgShellSurfaceType::XdgShellStable << bottomRight << 1 << 1; | ||
127 | QTest::newRow("XdgWmBase - topLeft") << Test::XdgShellSurfaceType::XdgShellStable << topLeft << -1 << -1; | 123 | QTest::newRow("XdgWmBase - topLeft") << Test::XdgShellSurfaceType::XdgShellStable << topLeft << -1 << -1; | ||
128 | QTest::newRow("XdgWmBase - topRight") << Test::XdgShellSurfaceType::XdgShellStable << topRight << 1 << -1; | 124 | QTest::newRow("XdgWmBase - topRight") << Test::XdgShellSurfaceType::XdgShellStable << topRight << 1 << -1; | ||
129 | } | 125 | } | ||
130 | 126 | | |||
131 | void TestPointerConstraints::testConfinedPointer() | 127 | void TestPointerConstraints::testConfinedPointer() | ||
132 | { | 128 | { | ||
▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Line(s) | |||||
286 | QVERIFY(Test::waitForWindowDestroyed(c)); | 282 | QVERIFY(Test::waitForWindowDestroyed(c)); | ||
287 | QCOMPARE(input()->pointer()->isConstrained(), false); | 283 | QCOMPARE(input()->pointer()->isConstrained(), false); | ||
288 | } | 284 | } | ||
289 | 285 | | |||
290 | void TestPointerConstraints::testLockedPointer_data() | 286 | void TestPointerConstraints::testLockedPointer_data() | ||
291 | { | 287 | { | ||
292 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); | 288 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); | ||
293 | 289 | | |||
294 | QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6; | | |||
295 | QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; | 290 | QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; | ||
296 | } | 291 | } | ||
297 | 292 | | |||
298 | void TestPointerConstraints::testLockedPointer() | 293 | void TestPointerConstraints::testLockedPointer() | ||
299 | { | 294 | { | ||
300 | // this test sets up a Surface with a locked pointer | 295 | // this test sets up a Surface with a locked pointer | ||
301 | // simple interaction test to verify that the pointer gets locked | 296 | // simple interaction test to verify that the pointer gets locked | ||
302 | // the various ways to unlock are not tested as that's already verified by testConfinedPointer | 297 | // the various ways to unlock are not tested as that's already verified by testConfinedPointer | ||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
363 | KWin::Cursor::setPos(c->frameGeometry().center()); | 358 | KWin::Cursor::setPos(c->frameGeometry().center()); | ||
364 | QCOMPARE(KWin::Cursor::pos(), c->frameGeometry().center()); | 359 | QCOMPARE(KWin::Cursor::pos(), c->frameGeometry().center()); | ||
365 | } | 360 | } | ||
366 | 361 | | |||
367 | void TestPointerConstraints::testCloseWindowWithLockedPointer_data() | 362 | void TestPointerConstraints::testCloseWindowWithLockedPointer_data() | ||
368 | { | 363 | { | ||
369 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); | 364 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); | ||
370 | 365 | | |||
371 | QTest::newRow("XdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6; | | |||
372 | QTest::newRow("XdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; | 366 | QTest::newRow("XdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; | ||
373 | } | 367 | } | ||
374 | 368 | | |||
375 | void TestPointerConstraints::testCloseWindowWithLockedPointer() | 369 | void TestPointerConstraints::testCloseWindowWithLockedPointer() | ||
376 | { | 370 | { | ||
377 | // test case which verifies that the pointer gets unlocked when the window for it gets closed | 371 | // test case which verifies that the pointer gets unlocked when the window for it gets closed | ||
378 | QScopedPointer<Surface> surface(Test::createSurface()); | 372 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
379 | QFETCH(Test::XdgShellSurfaceType, type); | 373 | QFETCH(Test::XdgShellSurfaceType, type); | ||
Show All 30 Lines |