Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/maximize_test.cpp
Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Line(s) | 183 | { | |||
---|---|---|---|---|---|
199 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | 199 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | ||
200 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | 200 | QVERIFY(!states.testFlag(XdgShellSurface::State::Activated)); | ||
201 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | 201 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | ||
202 | 202 | | |||
203 | // Now let's render in an incorrect size. | 203 | // Now let's render in an incorrect size. | ||
204 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | 204 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | ||
205 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | 205 | XdgShellClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); | ||
206 | QVERIFY(client); | 206 | QVERIFY(client); | ||
207 | QCOMPARE(client->geometry(), QRect(0, 0, 100, 50)); | 207 | QCOMPARE(client->frameGeometry(), QRect(0, 0, 100, 50)); | ||
208 | QEXPECT_FAIL("", "Should go out of maximzied", Continue); | 208 | QEXPECT_FAIL("", "Should go out of maximzied", Continue); | ||
209 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | 209 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | ||
210 | 210 | | |||
211 | // Destroy the client. | 211 | // Destroy the client. | ||
212 | shellSurface.reset(); | 212 | shellSurface.reset(); | ||
213 | QVERIFY(Test::waitForWindowDestroyed(client)); | 213 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
214 | } | 214 | } | ||
215 | 215 | | |||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 217 | { | |||
259 | // We should receive a configure event when the client becomes active. | 259 | // We should receive a configure event when the client becomes active. | ||
260 | QVERIFY(configureRequestedSpy.wait()); | 260 | QVERIFY(configureRequestedSpy.wait()); | ||
261 | QCOMPARE(configureRequestedSpy.count(), 2); | 261 | QCOMPARE(configureRequestedSpy.count(), 2); | ||
262 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | 262 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | ||
263 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 263 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
264 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | 264 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | ||
265 | 265 | | |||
266 | // Maximize the client. | 266 | // Maximize the client. | ||
267 | const QRect maximizeRestoreGeometry = client->geometry(); | 267 | const QRect maximizeRestoreGeometry = client->frameGeometry(); | ||
268 | workspace()->slotWindowMaximize(); | 268 | workspace()->slotWindowMaximize(); | ||
269 | QVERIFY(configureRequestedSpy.wait()); | 269 | QVERIFY(configureRequestedSpy.wait()); | ||
270 | QCOMPARE(configureRequestedSpy.count(), 3); | 270 | QCOMPARE(configureRequestedSpy.count(), 3); | ||
271 | QCOMPARE(configureRequestedSpy.last().at(0).toSize(), QSize(1280, 1024)); | 271 | QCOMPARE(configureRequestedSpy.last().at(0).toSize(), QSize(1280, 1024)); | ||
272 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | 272 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | ||
273 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 273 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
274 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | 274 | QVERIFY(states.testFlag(XdgShellSurface::State::Maximized)); | ||
275 | 275 | | |||
276 | QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); | 276 | QSignalSpy geometryChangedSpy(client, &AbstractClient::geometryChanged); | ||
277 | QVERIFY(geometryChangedSpy.isValid()); | 277 | QVERIFY(geometryChangedSpy.isValid()); | ||
278 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | 278 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | ||
279 | Test::render(surface.data(), QSize(1280, 1024), Qt::blue); | 279 | Test::render(surface.data(), QSize(1280, 1024), Qt::blue); | ||
280 | QVERIFY(geometryChangedSpy.wait()); | 280 | QVERIFY(geometryChangedSpy.wait()); | ||
281 | QCOMPARE(client->geometry(), QRect(0, 0, 1280, 1024)); | 281 | QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024)); | ||
282 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | 282 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeFull); | ||
283 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | 283 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeFull); | ||
284 | QCOMPARE(client->isDecorated(), false); | 284 | QCOMPARE(client->isDecorated(), false); | ||
285 | 285 | | |||
286 | // Restore the client. | 286 | // Restore the client. | ||
287 | workspace()->slotWindowMaximize(); | 287 | workspace()->slotWindowMaximize(); | ||
288 | QVERIFY(configureRequestedSpy.wait()); | 288 | QVERIFY(configureRequestedSpy.wait()); | ||
289 | QCOMPARE(configureRequestedSpy.count(), 4); | 289 | QCOMPARE(configureRequestedSpy.count(), 4); | ||
290 | QCOMPARE(configureRequestedSpy.last().at(0).toSize(), QSize(100, 50)); | 290 | QCOMPARE(configureRequestedSpy.last().at(0).toSize(), QSize(100, 50)); | ||
291 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | 291 | states = configureRequestedSpy.last().at(1).value<XdgShellSurface::States>(); | ||
292 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | 292 | QVERIFY(states.testFlag(XdgShellSurface::State::Activated)); | ||
293 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | 293 | QVERIFY(!states.testFlag(XdgShellSurface::State::Maximized)); | ||
294 | 294 | | |||
295 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | 295 | shellSurface->ackConfigure(configureRequestedSpy.last().at(2).value<quint32>()); | ||
296 | Test::render(surface.data(), QSize(100, 50), Qt::red); | 296 | Test::render(surface.data(), QSize(100, 50), Qt::red); | ||
297 | QVERIFY(geometryChangedSpy.wait()); | 297 | QVERIFY(geometryChangedSpy.wait()); | ||
298 | QCOMPARE(client->geometry(), maximizeRestoreGeometry); | 298 | QCOMPARE(client->frameGeometry(), maximizeRestoreGeometry); | ||
299 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | 299 | QCOMPARE(client->maximizeMode(), MaximizeMode::MaximizeRestore); | ||
300 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | 300 | QCOMPARE(client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore); | ||
301 | QCOMPARE(client->isDecorated(), true); | 301 | QCOMPARE(client->isDecorated(), true); | ||
302 | 302 | | |||
303 | // Destroy the client. | 303 | // Destroy the client. | ||
304 | shellSurface.reset(); | 304 | shellSurface.reset(); | ||
305 | QVERIFY(Test::waitForWindowDestroyed(client)); | 305 | QVERIFY(Test::waitForWindowDestroyed(client)); | ||
306 | } | 306 | } | ||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |