[autotests/integration] Add test case for minimizing active ShellClient

When minimizing an active ShellClient it should become inactive.
This is not the case as the test case shows through expected failures.

CCBUG: 366634
icc-effect-5.14.5
Martin Gräßlin 2016-08-11 17:08:08 +02:00
parent cd6d82fcbc
commit ec596519c6
1 changed files with 28 additions and 0 deletions

View File

@ -50,6 +50,8 @@ private Q_SLOTS:
void testMapUnmapMap();
void testDesktopPresenceChanged();
void testTransientPositionAfterRemap();
void testMinimizeActiveWindow_data();
void testMinimizeActiveWindow();
};
void TestShellClient::initTestCase()
@ -239,5 +241,31 @@ void TestShellClient::testTransientPositionAfterRemap()
QCOMPARE(transient->geometry(), QRect(c->geometry().topLeft() + QPoint(5, 10), QSize(50, 40)));
}
void TestShellClient::testMinimizeActiveWindow_data()
{
QTest::addColumn<Test::ShellSurfaceType>("type");
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
}
void TestShellClient::testMinimizeActiveWindow()
{
// this test verifies that when minimizing the active window it gets deactivated
QScopedPointer<Surface> surface(Test::createSurface());
QFETCH(Test::ShellSurfaceType, type);
QScopedPointer<QObject> shellSurface(Test::createShellSurface(type, surface.data()));
auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(c);
QVERIFY(c->isActive());
QCOMPARE(workspace()->activeClient(), c);
workspace()->slotWindowMinimize();
QEXPECT_FAIL("", "BUG 366634", Continue);
QVERIFY(!c->isActive());
QEXPECT_FAIL("", "BUG 366634", Continue);
QVERIFY(!workspace()->activeClient());
}
WAYLANDTEST_MAIN(TestShellClient)
#include "shell_client_test.moc"