Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/pointer_constraints_test.cpp
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 112 | { | |||
---|---|---|---|---|---|
114 | QTest::addColumn<PointerFunc>("positionFunction"); | 114 | QTest::addColumn<PointerFunc>("positionFunction"); | ||
115 | QTest::addColumn<int>("xOffset"); | 115 | QTest::addColumn<int>("xOffset"); | ||
116 | QTest::addColumn<int>("yOffset"); | 116 | QTest::addColumn<int>("yOffset"); | ||
117 | PointerFunc bottomLeft = &QRect::bottomLeft; | 117 | PointerFunc bottomLeft = &QRect::bottomLeft; | ||
118 | PointerFunc bottomRight = &QRect::bottomRight; | 118 | PointerFunc bottomRight = &QRect::bottomRight; | ||
119 | PointerFunc topRight = &QRect::topRight; | 119 | PointerFunc topRight = &QRect::topRight; | ||
120 | PointerFunc topLeft = &QRect::topLeft; | 120 | PointerFunc topLeft = &QRect::topLeft; | ||
121 | 121 | | |||
122 | QTest::newRow("XdgShellV5 - bottomLeft") << Test::XdgShellSurfaceType::XdgShellV5 << bottomLeft << -1 << 1; | | |||
123 | QTest::newRow("XdgShellV5 - bottomRight") << Test::XdgShellSurfaceType::XdgShellV5 << bottomRight << 1 << 1; | | |||
124 | QTest::newRow("XdgShellV5 - topLeft") << Test::XdgShellSurfaceType::XdgShellV5 << topLeft << -1 << -1; | | |||
125 | QTest::newRow("XdgShellV5 - topRight") << Test::XdgShellSurfaceType::XdgShellV5 << topRight << 1 << -1; | | |||
126 | QTest::newRow("XdgShellV6 - bottomLeft") << Test::XdgShellSurfaceType::XdgShellV6 << bottomLeft << -1 << 1; | 122 | QTest::newRow("XdgShellV6 - bottomLeft") << Test::XdgShellSurfaceType::XdgShellV6 << bottomLeft << -1 << 1; | ||
127 | QTest::newRow("XdgShellV6 - bottomRight") << Test::XdgShellSurfaceType::XdgShellV6 << bottomRight << 1 << 1; | 123 | QTest::newRow("XdgShellV6 - bottomRight") << Test::XdgShellSurfaceType::XdgShellV6 << bottomRight << 1 << 1; | ||
128 | QTest::newRow("XdgShellV6 - topLeft") << Test::XdgShellSurfaceType::XdgShellV6 << topLeft << -1 << -1; | 124 | QTest::newRow("XdgShellV6 - topLeft") << Test::XdgShellSurfaceType::XdgShellV6 << topLeft << -1 << -1; | ||
129 | QTest::newRow("XdgShellV6 - topRight") << Test::XdgShellSurfaceType::XdgShellV6 << topRight << 1 << -1; | 125 | QTest::newRow("XdgShellV6 - topRight") << Test::XdgShellSurfaceType::XdgShellV6 << topRight << 1 << -1; | ||
130 | QTest::newRow("XdgWmBase - bottomLeft") << Test::XdgShellSurfaceType::XdgShellStable << bottomLeft << -1 << 1; | 126 | QTest::newRow("XdgWmBase - bottomLeft") << Test::XdgShellSurfaceType::XdgShellStable << bottomLeft << -1 << 1; | ||
131 | QTest::newRow("XdgWmBase - bottomRight") << Test::XdgShellSurfaceType::XdgShellStable << bottomRight << 1 << 1; | 127 | QTest::newRow("XdgWmBase - bottomRight") << Test::XdgShellSurfaceType::XdgShellStable << bottomRight << 1 << 1; | ||
132 | QTest::newRow("XdgWmBase - topLeft") << Test::XdgShellSurfaceType::XdgShellStable << topLeft << -1 << -1; | 128 | QTest::newRow("XdgWmBase - topLeft") << Test::XdgShellSurfaceType::XdgShellStable << topLeft << -1 << -1; | ||
133 | QTest::newRow("XdgWmBase - topRight") << Test::XdgShellSurfaceType::XdgShellStable << topRight << 1 << -1; | 129 | QTest::newRow("XdgWmBase - topRight") << Test::XdgShellSurfaceType::XdgShellStable << topRight << 1 << -1; | ||
▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Line(s) | 133 | { | |||
291 | QVERIFY(Test::waitForWindowDestroyed(c)); | 287 | QVERIFY(Test::waitForWindowDestroyed(c)); | ||
292 | QCOMPARE(input()->pointer()->isConstrained(), false); | 288 | QCOMPARE(input()->pointer()->isConstrained(), false); | ||
293 | } | 289 | } | ||
294 | 290 | | |||
295 | void TestPointerConstraints::testLockedPointer_data() | 291 | void TestPointerConstraints::testLockedPointer_data() | ||
296 | { | 292 | { | ||
297 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); | 293 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); | ||
298 | 294 | | |||
299 | QTest::newRow("xdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5; | | |||
300 | QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6; | 295 | QTest::newRow("xdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6; | ||
301 | QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; | 296 | QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; | ||
302 | } | 297 | } | ||
303 | 298 | | |||
304 | void TestPointerConstraints::testLockedPointer() | 299 | void TestPointerConstraints::testLockedPointer() | ||
305 | { | 300 | { | ||
306 | // this test sets up a Surface with a locked pointer | 301 | // this test sets up a Surface with a locked pointer | ||
307 | // simple interaction test to verify that the pointer gets locked | 302 | // simple interaction test to verify that the pointer gets locked | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | |||||
369 | KWin::Cursor::setPos(c->geometry().center()); | 364 | KWin::Cursor::setPos(c->geometry().center()); | ||
370 | QCOMPARE(KWin::Cursor::pos(), c->geometry().center()); | 365 | QCOMPARE(KWin::Cursor::pos(), c->geometry().center()); | ||
371 | } | 366 | } | ||
372 | 367 | | |||
373 | void TestPointerConstraints::testCloseWindowWithLockedPointer_data() | 368 | void TestPointerConstraints::testCloseWindowWithLockedPointer_data() | ||
374 | { | 369 | { | ||
375 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); | 370 | QTest::addColumn<Test::XdgShellSurfaceType>("type"); | ||
376 | 371 | | |||
377 | QTest::newRow("XdgShellV5") << Test::XdgShellSurfaceType::XdgShellV5; | | |||
378 | QTest::newRow("XdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6; | 372 | QTest::newRow("XdgShellV6") << Test::XdgShellSurfaceType::XdgShellV6; | ||
379 | QTest::newRow("XdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; | 373 | QTest::newRow("XdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; | ||
380 | } | 374 | } | ||
381 | 375 | | |||
382 | void TestPointerConstraints::testCloseWindowWithLockedPointer() | 376 | void TestPointerConstraints::testCloseWindowWithLockedPointer() | ||
383 | { | 377 | { | ||
384 | // test case which verifies that the pointer gets unlocked when the window for it gets closed | 378 | // test case which verifies that the pointer gets unlocked when the window for it gets closed | ||
385 | QScopedPointer<Surface> surface(Test::createSurface()); | 379 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
Show All 31 Lines |