Changeset View
Changeset View
Standalone View
Standalone View
autotests/client/test_plasmashell.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 41 | private Q_SLOTS: | |||
---|---|---|---|---|---|
42 | void init(); | 42 | void init(); | ||
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 testPanelBehavior_data(); | 51 | void testPanelBehavior_data(); | ||
51 | void testPanelBehavior(); | 52 | void testPanelBehavior(); | ||
52 | void testAutoHidePanel(); | 53 | void testAutoHidePanel(); | ||
53 | void testPanelTakesFocus(); | 54 | void testPanelTakesFocus(); | ||
54 | void testDisconnect(); | 55 | void testDisconnect(); | ||
55 | void testWhileDestroying(); | 56 | void testWhileDestroying(); | ||
56 | 57 | | |||
57 | private: | 58 | private: | ||
▲ Show 20 Lines • Show All 234 Lines • ▼ Show 20 Line(s) | 267 | { | |||
292 | QVERIFY(sps->skipTaskbar()); | 293 | QVERIFY(sps->skipTaskbar()); | ||
293 | 294 | | |||
294 | // setting to false should change again | 295 | // setting to false should change again | ||
295 | ps->setSkipTaskbar(false); | 296 | ps->setSkipTaskbar(false); | ||
296 | QVERIFY(skipTaskbarChangedSpy.wait()); | 297 | QVERIFY(skipTaskbarChangedSpy.wait()); | ||
297 | QVERIFY(!sps->skipTaskbar()); | 298 | QVERIFY(!sps->skipTaskbar()); | ||
298 | } | 299 | } | ||
299 | 300 | | |||
301 | void TestPlasmaShell::testSkipSwitcher() | ||||
302 | { | ||||
303 | // this test verifies that Skip Switcher is properly passed to server | ||||
304 | QSignalSpy plasmaSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated); | ||||
305 | QVERIFY(plasmaSurfaceCreatedSpy.isValid()); | ||||
306 | | ||||
307 | QScopedPointer<Surface> s(m_compositor->createSurface()); | ||||
308 | QScopedPointer<PlasmaShellSurface> ps(m_plasmaShell->createSurface(s.data())); | ||||
309 | QVERIFY(plasmaSurfaceCreatedSpy.wait()); | ||||
310 | QCOMPARE(plasmaSurfaceCreatedSpy.count(), 1); | ||||
311 | | ||||
312 | // verify that we got a plasma shell surface | ||||
313 | auto sps = plasmaSurfaceCreatedSpy.first().first().value<PlasmaShellSurfaceInterface*>(); | ||||
314 | QVERIFY(sps); | ||||
315 | QVERIFY(sps->surface()); | ||||
316 | QVERIFY(!sps->skipSwitcher()); | ||||
317 | | ||||
318 | // now change | ||||
319 | QSignalSpy skipSwitcherChangedSpy(sps, &PlasmaShellSurfaceInterface::skipSwitcherChanged); | ||||
320 | QVERIFY(skipSwitcherChangedSpy.isValid()); | ||||
321 | ps->setSkipSwitcher(true); | ||||
322 | QVERIFY(skipSwitcherChangedSpy.wait()); | ||||
323 | QVERIFY(sps->skipSwitcher()); | ||||
324 | // setting to same again should not emit the signal | ||||
325 | ps->setSkipSwitcher(true); | ||||
326 | QEXPECT_FAIL("", "Should not be emitted if not changed", Continue); | ||||
327 | QVERIFY(!skipSwitcherChangedSpy.wait(100)); | ||||
328 | QVERIFY(sps->skipSwitcher()); | ||||
329 | | ||||
330 | // setting to false should change again | ||||
331 | ps->setSkipSwitcher(false); | ||||
332 | QVERIFY(skipSwitcherChangedSpy.wait()); | ||||
333 | QVERIFY(!sps->skipSwitcher()); | ||||
334 | } | ||||
335 | | ||||
300 | void TestPlasmaShell::testPanelBehavior_data() | 336 | void TestPlasmaShell::testPanelBehavior_data() | ||
301 | { | 337 | { | ||
302 | QTest::addColumn<PlasmaShellSurface::PanelBehavior>("client"); | 338 | QTest::addColumn<PlasmaShellSurface::PanelBehavior>("client"); | ||
303 | QTest::addColumn<PlasmaShellSurfaceInterface::PanelBehavior>("server"); | 339 | QTest::addColumn<PlasmaShellSurfaceInterface::PanelBehavior>("server"); | ||
304 | 340 | | |||
305 | QTest::newRow("autohide") << PlasmaShellSurface::PanelBehavior::AutoHide << PlasmaShellSurfaceInterface::PanelBehavior::AutoHide; | 341 | QTest::newRow("autohide") << PlasmaShellSurface::PanelBehavior::AutoHide << PlasmaShellSurfaceInterface::PanelBehavior::AutoHide; | ||
306 | QTest::newRow("can cover") << PlasmaShellSurface::PanelBehavior::WindowsCanCover << PlasmaShellSurfaceInterface::PanelBehavior::WindowsCanCover; | 342 | QTest::newRow("can cover") << PlasmaShellSurface::PanelBehavior::WindowsCanCover << PlasmaShellSurfaceInterface::PanelBehavior::WindowsCanCover; | ||
307 | QTest::newRow("go below") << PlasmaShellSurface::PanelBehavior::WindowsGoBelow << PlasmaShellSurfaceInterface::PanelBehavior::WindowsGoBelow; | 343 | QTest::newRow("go below") << PlasmaShellSurface::PanelBehavior::WindowsGoBelow << PlasmaShellSurfaceInterface::PanelBehavior::WindowsGoBelow; | ||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |