Changeset View
Changeset View
Standalone View
Standalone View
autotests/client/test_plasmashell.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 41 | private Q_SLOTS: | |||
---|---|---|---|---|---|
43 | void cleanup(); | 43 | void cleanup(); | ||
44 | 44 | | |||
45 | 45 | | |||
46 | void testRole_data(); | 46 | void testRole_data(); | ||
47 | void testRole(); | 47 | void testRole(); | ||
48 | void testPosition(); | 48 | void testPosition(); | ||
49 | void testSkipTaskbar(); | 49 | void testSkipTaskbar(); | ||
50 | void testSkipSwitcher(); | 50 | void testSkipSwitcher(); | ||
51 | void testSkipPager(); | ||||
51 | void testPanelBehavior_data(); | 52 | void testPanelBehavior_data(); | ||
52 | void testPanelBehavior(); | 53 | void testPanelBehavior(); | ||
53 | void testAutoHidePanel(); | 54 | void testAutoHidePanel(); | ||
54 | void testPanelTakesFocus(); | 55 | void testPanelTakesFocus(); | ||
55 | void testDisconnect(); | 56 | void testDisconnect(); | ||
56 | void testWhileDestroying(); | 57 | void testWhileDestroying(); | ||
57 | 58 | | |||
58 | private: | 59 | private: | ||
▲ Show 20 Lines • Show All 269 Lines • ▼ Show 20 Line(s) | 303 | { | |||
328 | QVERIFY(sps->skipSwitcher()); | 329 | QVERIFY(sps->skipSwitcher()); | ||
329 | 330 | | |||
330 | // setting to false should change again | 331 | // setting to false should change again | ||
331 | ps->setSkipSwitcher(false); | 332 | ps->setSkipSwitcher(false); | ||
332 | QVERIFY(skipSwitcherChangedSpy.wait()); | 333 | QVERIFY(skipSwitcherChangedSpy.wait()); | ||
333 | QVERIFY(!sps->skipSwitcher()); | 334 | QVERIFY(!sps->skipSwitcher()); | ||
334 | } | 335 | } | ||
335 | 336 | | |||
337 | void TestPlasmaShell::testSkipPager() | ||||
338 | { | ||||
339 | // this test verifies that Skip Pager is properly passed to server | ||||
340 | QSignalSpy plasmaSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated); | ||||
341 | QVERIFY(plasmaSurfaceCreatedSpy.isValid()); | ||||
342 | | ||||
343 | QScopedPointer<Surface> s(m_compositor->createSurface()); | ||||
344 | QScopedPointer<PlasmaShellSurface> ps(m_plasmaShell->createSurface(s.data())); | ||||
345 | QVERIFY(plasmaSurfaceCreatedSpy.wait()); | ||||
346 | QCOMPARE(plasmaSurfaceCreatedSpy.count(), 1); | ||||
347 | | ||||
348 | // verify that we got a plasma shell surface | ||||
349 | auto sps = plasmaSurfaceCreatedSpy.first().first().value<PlasmaShellSurfaceInterface*>(); | ||||
350 | QVERIFY(sps); | ||||
351 | QVERIFY(sps->surface()); | ||||
352 | QVERIFY(!sps->skipPager()); | ||||
353 | | ||||
354 | // now change | ||||
355 | QSignalSpy skipPagerChangedSpy(sps, &PlasmaShellSurfaceInterface::skipPagerChanged); | ||||
356 | QVERIFY(skipPagerChangedSpy.isValid()); | ||||
357 | ps->setSkipPager(true); | ||||
358 | QVERIFY(skipPagerChangedSpy.wait()); | ||||
359 | QVERIFY(sps->skipPager()); | ||||
360 | // setting to same again should not emit the signal | ||||
361 | ps->setSkipPager(true); | ||||
362 | QEXPECT_FAIL("", "Should not be emitted if not changed", Continue); | ||||
363 | QVERIFY(!skipPagerChangedSpy.wait(100)); | ||||
364 | QVERIFY(sps->skipPager()); | ||||
365 | | ||||
366 | // setting to false should change again | ||||
367 | ps->setSkipPager(false); | ||||
368 | QVERIFY(skipPagerChangedSpy.wait()); | ||||
369 | QVERIFY(!sps->skipPager()); | ||||
370 | } | ||||
371 | | ||||
372 | | ||||
336 | void TestPlasmaShell::testPanelBehavior_data() | 373 | void TestPlasmaShell::testPanelBehavior_data() | ||
337 | { | 374 | { | ||
338 | QTest::addColumn<PlasmaShellSurface::PanelBehavior>("client"); | 375 | QTest::addColumn<PlasmaShellSurface::PanelBehavior>("client"); | ||
339 | QTest::addColumn<PlasmaShellSurfaceInterface::PanelBehavior>("server"); | 376 | QTest::addColumn<PlasmaShellSurfaceInterface::PanelBehavior>("server"); | ||
340 | 377 | | |||
341 | QTest::newRow("autohide") << PlasmaShellSurface::PanelBehavior::AutoHide << PlasmaShellSurfaceInterface::PanelBehavior::AutoHide; | 378 | QTest::newRow("autohide") << PlasmaShellSurface::PanelBehavior::AutoHide << PlasmaShellSurfaceInterface::PanelBehavior::AutoHide; | ||
342 | QTest::newRow("can cover") << PlasmaShellSurface::PanelBehavior::WindowsCanCover << PlasmaShellSurfaceInterface::PanelBehavior::WindowsCanCover; | 379 | QTest::newRow("can cover") << PlasmaShellSurface::PanelBehavior::WindowsCanCover << PlasmaShellSurfaceInterface::PanelBehavior::WindowsCanCover; | ||
343 | QTest::newRow("go below") << PlasmaShellSurface::PanelBehavior::WindowsGoBelow << PlasmaShellSurfaceInterface::PanelBehavior::WindowsGoBelow; | 380 | QTest::newRow("go below") << PlasmaShellSurface::PanelBehavior::WindowsGoBelow << PlasmaShellSurfaceInterface::PanelBehavior::WindowsGoBelow; | ||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |