Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/effects/toplevel_open_close_animation_test.cpp
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Line(s) | 111 | { | |||
---|---|---|---|---|---|
130 | QScopedPointer<Surface> surface(Test::createSurface()); | 130 | QScopedPointer<Surface> surface(Test::createSurface()); | ||
131 | QVERIFY(!surface.isNull()); | 131 | QVERIFY(!surface.isNull()); | ||
132 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | 132 | QScopedPointer<XdgShellSurface> shellSurface(Test::createXdgShellStableSurface(surface.data())); | ||
133 | QVERIFY(!shellSurface.isNull()); | 133 | QVERIFY(!shellSurface.isNull()); | ||
134 | ShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 134 | ShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
135 | QVERIFY(client); | 135 | QVERIFY(client); | ||
136 | QVERIFY(effect->isActive()); | 136 | QVERIFY(effect->isActive()); | ||
137 | 137 | | |||
138 | // None of effects lasts longer than 1000ms, so after that duration the effect | 138 | // Eventually, the animation will be complete. | ||
139 | // should not be active anymore, i.e. the animation is complete. | 139 | QTRY_VERIFY(!effect->isActive()); | ||
davidedmundson: There's a QTRY_VERIFY_WITH_TIMEOUT which would allow us to keep the check that everything… | |||||
1s was a semi-arbitrary choice. Given that CI can sometimes be under heavy load, I think that's fine to have 5s timeout. :-) zzag: 1s was a semi-arbitrary choice.
Given that CI can sometimes be under heavy load, I think… | |||||
140 | QTest::qWait(1000); | | |||
141 | QVERIFY(!effect->isActive()); | | |||
142 | 140 | | |||
143 | // Close the test client, the effect should start animating the disappearing | 141 | // Close the test client, the effect should start animating the disappearing | ||
144 | // of the client. | 142 | // of the client. | ||
145 | QSignalSpy windowClosedSpy(client, &ShellClient::windowClosed); | 143 | QSignalSpy windowClosedSpy(client, &ShellClient::windowClosed); | ||
146 | QVERIFY(windowClosedSpy.isValid()); | 144 | QVERIFY(windowClosedSpy.isValid()); | ||
147 | shellSurface.reset(); | 145 | shellSurface.reset(); | ||
148 | surface.reset(); | 146 | surface.reset(); | ||
149 | QVERIFY(windowClosedSpy.wait()); | 147 | QVERIFY(windowClosedSpy.wait()); | ||
150 | QVERIFY(effect->isActive()); | 148 | QVERIFY(effect->isActive()); | ||
151 | 149 | | |||
152 | // None of effects lasts longer than 1000ms, so after that duration the effect | 150 | // Eventually, the animation will be complete. | ||
153 | // should not be active anymore, i.e. the animation is complete. | 151 | QTRY_VERIFY(!effect->isActive()); | ||
154 | QTest::qWait(1000); | | |||
155 | QVERIFY(!effect->isActive()); | | |||
156 | } | 152 | } | ||
157 | 153 | | |||
158 | void ToplevelOpenCloseAnimationTest::testDontAnimatePopups_data() | 154 | void ToplevelOpenCloseAnimationTest::testDontAnimatePopups_data() | ||
159 | { | 155 | { | ||
160 | QTest::addColumn<QString>("effectName"); | 156 | QTest::addColumn<QString>("effectName"); | ||
161 | 157 | | |||
162 | QTest::newRow("Fade") << QStringLiteral("kwin4_effect_fade"); | 158 | QTest::newRow("Fade") << QStringLiteral("kwin4_effect_fade"); | ||
163 | QTest::newRow("Glide") << QStringLiteral("glide"); | 159 | QTest::newRow("Glide") << QStringLiteral("glide"); | ||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |
There's a QTRY_VERIFY_WITH_TIMEOUT which would allow us to keep the check that everything lasted < 1s.