From 405702b1a2b4c38ce77f7698059f5ea115fa2185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 12 Sep 2016 14:14:20 +0200 Subject: [PATCH] [autotest/integration] Extend TestShellClient::testFullscreen with deco In addition to normal client to fullscreen two more cases are added which also go from a server side decorated window to fullscreen. This highlights an issue that an incorrect geometry is requested. CCBUG: 366764 --- autotests/integration/shell_client_test.cpp | 30 +++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/autotests/integration/shell_client_test.cpp b/autotests/integration/shell_client_test.cpp index 016e793a1a..85af83cf2e 100644 --- a/autotests/integration/shell_client_test.cpp +++ b/autotests/integration/shell_client_test.cpp @@ -29,6 +29,7 @@ along with this program. If not, see . #include #include #include +#include #include #include @@ -77,7 +78,7 @@ void TestShellClient::initTestCase() void TestShellClient::init() { - QVERIFY(Test::setupWaylandConnection(s_socketName)); + QVERIFY(Test::setupWaylandConnection(s_socketName, Test::AdditionalWaylandInterface::Decoration)); screens()->setCurrent(0); KWin::Cursor::setPos(QPoint(1280, 512)); @@ -295,9 +296,13 @@ void TestShellClient::testMinimizeActiveWindow() void TestShellClient::testFullscreen_data() { QTest::addColumn("type"); + QTest::addColumn("decoMode"); - QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell; - QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5; + QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell << ServerSideDecoration::Mode::Client; + QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5 << ServerSideDecoration::Mode::Client; + + QTest::newRow("wlShell - deco") << Test::ShellSurfaceType::WlShell << ServerSideDecoration::Mode::Server; + QTest::newRow("xdgShellV5 - deco") << Test::ShellSurfaceType::XdgShellV5 << ServerSideDecoration::Mode::Server; } void TestShellClient::testFullscreen() @@ -306,11 +311,22 @@ void TestShellClient::testFullscreen() QScopedPointer surface(Test::createSurface()); QFETCH(Test::ShellSurfaceType, type); QScopedPointer shellSurface(Test::createShellSurface(type, surface.data())); + + // create deco + QScopedPointer deco(Test::waylandServerSideDecoration()->create(surface.data())); + QSignalSpy decoSpy(deco.data(), &ServerSideDecoration::modeChanged); + QVERIFY(decoSpy.isValid()); + QVERIFY(decoSpy.wait()); + QFETCH(ServerSideDecoration::Mode, decoMode); + deco->requestMode(decoMode); + QVERIFY(decoSpy.wait()); + QCOMPARE(deco->mode(), decoMode); + auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); QVERIFY(c->isActive()); QVERIFY(!c->isFullScreen()); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->clientSize(), QSize(100, 50)); QSignalSpy fullscreenChangedSpy(c, &ShellClient::fullScreenChanged); QVERIFY(fullscreenChangedSpy.isValid()); QSignalSpy geometryChangedSpy(c, &ShellClient::geometryChanged); @@ -333,10 +349,12 @@ void TestShellClient::testFullscreen() QVERIFY(fullscreenChangedSpy.wait()); QVERIFY(sizeChangeRequestedSpy.wait()); QCOMPARE(sizeChangeRequestedSpy.count(), 1); + QEXPECT_FAIL("wlShell - deco", "BUG 366764", Continue); + QEXPECT_FAIL("xdgShellV5 - deco", "BUG 366764", Continue); QCOMPARE(sizeChangeRequestedSpy.first().first().toSize(), QSize(screens()->size(0))); // TODO: should switch to fullscreen once it's updated QVERIFY(c->isFullScreen()); - QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); + QCOMPARE(c->clientSize(), QSize(100, 50)); QVERIFY(geometryChangedSpy.isEmpty()); // render at the new size @@ -344,6 +362,8 @@ void TestShellClient::testFullscreen() QVERIFY(geometryChangedSpy.wait()); QCOMPARE(geometryChangedSpy.count(), 1); QVERIFY(c->isFullScreen()); + QEXPECT_FAIL("wlShell - deco", "BUG 366764", Continue); + QEXPECT_FAIL("xdgShellV5 - deco", "BUG 366764", Continue); QCOMPARE(c->geometry(), QRect(QPoint(0, 0), sizeChangeRequestedSpy.first().first().toSize())); // swap back to normal