diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2017-08-28 16:05:43 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2017-11-15 14:54:30 +0000 |
commit | 53c5a267b225c7492ac2ce0ba828d4de18ec59cc (patch) | |
tree | a6cbca2d8b76eba2a9528c4587cf5b6a41b51073 /tests/auto/client/client/tst_client.cpp | |
parent | 69d587b9a8e336cff4356c49e4f37aae2a474a4f (diff) |
Verify that the client supports the compositor removing outputs
Change-Id: I799d29fa43ad429b7973d7a210aca554d6b0ce26
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Diffstat (limited to 'tests/auto/client/client/tst_client.cpp')
-rw-r--r-- | tests/auto/client/client/tst_client.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp index b4dc75131..e02aa9f8f 100644 --- a/tests/auto/client/client/tst_client.cpp +++ b/tests/auto/client/client/tst_client.cpp @@ -138,6 +138,7 @@ public slots: private slots: void primaryScreen(); + void screens(); void windowScreens(); void createDestroyWindow(); void events(); @@ -158,6 +159,17 @@ void tst_WaylandClient::primaryScreen() QTRY_COMPARE(QGuiApplication::primaryScreen()->size(), screenSize); } +void tst_WaylandClient::screens() +{ + QTRY_COMPARE(QGuiApplication::screens().size(), 1); + compositor->sendAddOutput(); + QTRY_COMPARE(QGuiApplication::screens().size(), 2); + QSharedPointer<MockOutput> secondOutput; + QTRY_VERIFY(secondOutput = compositor->output(1)); + compositor->sendRemoveOutput(secondOutput); + QTRY_COMPARE(QGuiApplication::screens().size(), 1); +} + void tst_WaylandClient::windowScreens() { QSharedPointer<MockOutput> firstOutput; @@ -191,6 +203,10 @@ void tst_WaylandClient::windowScreens() compositor->sendSurfaceLeave(surface, firstOutput); QTRY_COMPARE(window.screen(), secondaryScreen); + compositor->sendRemoveOutput(secondOutput); + QTRY_COMPARE(QGuiApplication::screens().size(), 1); + QCOMPARE(window.screen(), primaryScreen); + window.destroy(); QTRY_VERIFY(!compositor->surface()); } |