From 47d87cd94fc9c99d181ef77ddbd215a00392dad7 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 8 Nov 2018 01:33:44 +0000 Subject: [PATCH] [autotests] Handle async maximisation in quick tiling test Summary: KWin now correctly updates the client maximised state when we have a new buffer in the new state. The quick tile unit test was unfortunately not updated. Reviewers: #kwin, graesslin Reviewed By: #kwin, graesslin Subscribers: graesslin, zzag, kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D16739 --- autotests/integration/quick_tiling_test.cpp | 36 +++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/autotests/integration/quick_tiling_test.cpp b/autotests/integration/quick_tiling_test.cpp index f72e6ed6c9..2cff3a0ee5 100644 --- a/autotests/integration/quick_tiling_test.cpp +++ b/autotests/integration/quick_tiling_test.cpp @@ -258,18 +258,11 @@ void QuickTilingTest::testQuickMaximizing() c->setQuickTileMode(QuickTileFlag::Maximize, true); QCOMPARE(quickTileChangedSpy.count(), 1); - QCOMPARE(maximizeChangedSpy1.count(), 1); - QCOMPARE(maximizeChangedSpy1.first().first().value(), c); - QCOMPARE(maximizeChangedSpy1.first().last().value(), MaximizeFull); - QCOMPARE(maximizeChangedSpy2.count(), 1); - QCOMPARE(maximizeChangedSpy2.first().first().value(), c); - QCOMPARE(maximizeChangedSpy2.first().at(1).toBool(), true); - QCOMPARE(maximizeChangedSpy2.first().at(2).toBool(), true); + // at this point the geometry did not yet change QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); // but quick tile mode already changed QCOMPARE(c->quickTileMode(), QuickTileFlag::Maximize); - QCOMPARE(c->maximizeMode(), MaximizeFull); QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); // but we got requested a new geometry @@ -286,19 +279,21 @@ void QuickTilingTest::testQuickMaximizing() QCOMPARE(c->geometry(), QRect(0, 0, 1280, 1024)); QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); + // client is now set to maximised + QCOMPARE(maximizeChangedSpy1.count(), 1); + QCOMPARE(maximizeChangedSpy1.first().first().value(), c); + QCOMPARE(maximizeChangedSpy1.first().last().value(), MaximizeFull); + QCOMPARE(maximizeChangedSpy2.count(), 1); + QCOMPARE(maximizeChangedSpy2.first().first().value(), c); + QCOMPARE(maximizeChangedSpy2.first().at(1).toBool(), true); + QCOMPARE(maximizeChangedSpy2.first().at(2).toBool(), true); + QCOMPARE(c->maximizeMode(), MaximizeFull); + // go back to quick tile none QFETCH(QuickTileMode, mode); c->setQuickTileMode(mode, true); - QCOMPARE(quickTileChangedSpy.count(), 2); - QCOMPARE(maximizeChangedSpy1.count(), 2); - QCOMPARE(maximizeChangedSpy1.last().first().value(), c); - QCOMPARE(maximizeChangedSpy1.last().last().value(), MaximizeRestore); - QCOMPARE(maximizeChangedSpy2.count(), 2); - QCOMPARE(maximizeChangedSpy2.last().first().value(), c); - QCOMPARE(maximizeChangedSpy2.last().at(1).toBool(), false); - QCOMPARE(maximizeChangedSpy2.last().at(2).toBool(), false); QCOMPARE(c->quickTileMode(), QuickTileMode(QuickTileFlag::None)); - QCOMPARE(c->maximizeMode(), MaximizeRestore); + QCOMPARE(quickTileChangedSpy.count(), 2); // geometry not yet changed QCOMPARE(c->geometry(), QRect(0, 0, 1280, 1024)); QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); @@ -315,6 +310,13 @@ void QuickTilingTest::testQuickMaximizing() QCOMPARE(geometryChangedSpy.count(), 4); QCOMPARE(c->geometry(), QRect(0, 0, 100, 50)); QCOMPARE(c->geometryRestore(), QRect(0, 0, 100, 50)); + QCOMPARE(maximizeChangedSpy1.count(), 2); + QCOMPARE(maximizeChangedSpy1.last().first().value(), c); + QCOMPARE(maximizeChangedSpy1.last().last().value(), MaximizeRestore); + QCOMPARE(maximizeChangedSpy2.count(), 2); + QCOMPARE(maximizeChangedSpy2.last().first().value(), c); + QCOMPARE(maximizeChangedSpy2.last().at(1).toBool(), false); + QCOMPARE(maximizeChangedSpy2.last().at(2).toBool(), false); } void QuickTilingTest::testQuickTilingKeyboardMove_data()