From ec596519c60279b68c513a7071e29af88ad74a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 11 Aug 2016 17:08:08 +0200 Subject: [PATCH] [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 --- autotests/integration/shell_client_test.cpp | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/autotests/integration/shell_client_test.cpp b/autotests/integration/shell_client_test.cpp index 61c16393e0..393c0c57c0 100644 --- a/autotests/integration/shell_client_test.cpp +++ b/autotests/integration/shell_client_test.cpp @@ -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("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(Test::createSurface()); + QFETCH(Test::ShellSurfaceType, type); + QScopedPointer 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"