Paste P294

Fix testQuickTiling
ActivePublic

Authored by zzag on Jan 28 2019, 8:38 PM.
From ab2cbe9dcfa22c8f89c404f44efd1b4c7e81a4c2 Mon Sep 17 00:00:00 2001
From: Vlad Zagorodniy <vladzzag@gmail.com>
Date: Mon, 28 Jan 2019 16:08:44 +0200
Subject: [PATCH] [autotests] Properly verify configure events in
testQuickTiling
Summary: We have to wait for a configure event before attaching a buffer.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18581
---
autotests/integration/quick_tiling_test.cpp | 24 +++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/autotests/integration/quick_tiling_test.cpp b/autotests/integration/quick_tiling_test.cpp
index 2cff3a0ee..e2594ad03 100644
--- a/autotests/integration/quick_tiling_test.cpp
+++ b/autotests/integration/quick_tiling_test.cpp
@@ -464,11 +464,19 @@ void QuickTilingTest::testQuickTilingPointerMoveXdgShell()
QScopedPointer<Surface> surface(Test::createSurface());
QVERIFY(!surface.isNull());
- QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellV6Surface(surface.data()));
+ QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellV6Surface(
+ surface.data(), surface.data(), Test::CreationSetup::CreateOnly));
QVERIFY(!shellSurface.isNull());
+
+ // wait for the initial configure event
QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
+ surface->commit();
+ QVERIFY(configureRequestedSpy.wait());
+ QCOMPARE(configureRequestedSpy.count(), 1);
+
// let's render
+ shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(c);
@@ -476,6 +484,8 @@ void QuickTilingTest::testQuickTilingPointerMoveXdgShell()
QCOMPARE(c->geometry(), QRect(0, 0, 100, 50));
QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None));
QCOMPARE(c->maximizeMode(), MaximizeRestore);
+
+ // we have to receive a configure event when the client becomes active
QVERIFY(configureRequestedSpy.wait());
QTRY_COMPARE(configureRequestedSpy.count(), 2);
@@ -526,11 +536,19 @@ void QuickTilingTest::testQuickTilingTouchMoveXdgShell()
QVERIFY(!surface.isNull());
QScopedPointer<ServerSideDecoration> deco(Test::waylandServerSideDecoration()->create(surface.data()));
- QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellV6Surface(surface.data()));
+ QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellV6Surface(
+ surface.data(), surface.data(), Test::CreationSetup::CreateOnly));
QVERIFY(!shellSurface.isNull());
+
+ // wait for the initial configure event
QSignalSpy configureRequestedSpy(shellSurface.data(), &XdgShellSurface::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
+ surface->commit();
+ QVERIFY(configureRequestedSpy.wait());
+ QCOMPARE(configureRequestedSpy.count(), 1);
+
// let's render
+ shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>());
auto c = Test::renderAndWaitForShown(surface.data(), QSize(1000, 50), Qt::blue);
QVERIFY(c);
@@ -542,6 +560,8 @@ void QuickTilingTest::testQuickTilingTouchMoveXdgShell()
50 + decoration->borderTop() + decoration->borderBottom()));
QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None));
QCOMPARE(c->maximizeMode(), MaximizeRestore);
+
+ // we have to receive a configure event when the client becomes active
QVERIFY(configureRequestedSpy.wait());
QTRY_COMPARE(configureRequestedSpy.count(), 2);
--
2.20.1
zzag created this paste.Jan 28 2019, 8:38 PM
zzag created this object in space S1 KDE Community.