Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/screen_changes_test.cpp
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 72 | { | |||
---|---|---|---|---|---|
91 | const quint32 firstOutputId = outputAnnouncedSpy.first().first().value<quint32>(); | 91 | const quint32 firstOutputId = outputAnnouncedSpy.first().first().value<quint32>(); | ||
92 | QVERIFY(firstOutputId != 0u); | 92 | QVERIFY(firstOutputId != 0u); | ||
93 | outputAnnouncedSpy.clear(); | 93 | outputAnnouncedSpy.clear(); | ||
94 | 94 | | |||
95 | // let's announce a new output | 95 | // let's announce a new output | ||
96 | QSignalSpy screensChangedSpy(screens(), &Screens::changed); | 96 | QSignalSpy screensChangedSpy(screens(), &Screens::changed); | ||
97 | QVERIFY(screensChangedSpy.isValid()); | 97 | QVERIFY(screensChangedSpy.isValid()); | ||
98 | const QVector<QRect> geometries{QRect(0, 0, 1280, 1024), QRect(1280, 0, 1280, 1024)}; | 98 | const QVector<QRect> geometries{QRect(0, 0, 1280, 1024), QRect(1280, 0, 1280, 1024)}; | ||
99 | QMetaObject::invokeMethod(kwinApp()->platform(), "outputGeometriesChanged", | 99 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | ||
100 | Qt::DirectConnection, | 100 | Qt::DirectConnection, | ||
101 | Q_ARG(int, 2), | ||||
101 | Q_ARG(QVector<QRect>, geometries)); | 102 | Q_ARG(QVector<QRect>, geometries)); | ||
102 | QVERIFY(screensChangedSpy.wait()); | 103 | QVERIFY(screensChangedSpy.wait()); | ||
103 | QCOMPARE(screensChangedSpy.count(), 1); | 104 | QCOMPARE(screensChangedSpy.count(), 1); | ||
104 | QCOMPARE(screens()->count(), 2); | 105 | QCOMPARE(screens()->count(), 2); | ||
105 | QCOMPARE(screens()->geometry(0), geometries.at(0)); | 106 | QCOMPARE(screens()->geometry(0), geometries.at(0)); | ||
106 | QCOMPARE(screens()->geometry(1), geometries.at(1)); | 107 | QCOMPARE(screens()->geometry(1), geometries.at(1)); | ||
107 | 108 | | |||
108 | // this should result in it getting announced, two new outputs are added... | 109 | // this should result in it getting announced, two new outputs are added... | ||
Show All 34 Lines | |||||
143 | screensChangedSpy.clear(); | 144 | screensChangedSpy.clear(); | ||
144 | 145 | | |||
145 | QSignalSpy o1RemovedSpy(o1.data(), &Output::removed); | 146 | QSignalSpy o1RemovedSpy(o1.data(), &Output::removed); | ||
146 | QVERIFY(o1RemovedSpy.isValid()); | 147 | QVERIFY(o1RemovedSpy.isValid()); | ||
147 | QSignalSpy o2RemovedSpy(o2.data(), &Output::removed); | 148 | QSignalSpy o2RemovedSpy(o2.data(), &Output::removed); | ||
148 | QVERIFY(o2RemovedSpy.isValid()); | 149 | QVERIFY(o2RemovedSpy.isValid()); | ||
149 | 150 | | |||
150 | const QVector<QRect> geometries2{QRect(0, 0, 1280, 1024)}; | 151 | const QVector<QRect> geometries2{QRect(0, 0, 1280, 1024)}; | ||
151 | QMetaObject::invokeMethod(kwinApp()->platform(), "outputGeometriesChanged", | 152 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | ||
152 | Qt::DirectConnection, | 153 | Qt::DirectConnection, | ||
154 | Q_ARG(int, 1), | ||||
153 | Q_ARG(QVector<QRect>, geometries2)); | 155 | Q_ARG(QVector<QRect>, geometries2)); | ||
154 | QVERIFY(screensChangedSpy.wait()); | 156 | QVERIFY(screensChangedSpy.wait()); | ||
155 | QCOMPARE(screensChangedSpy.count(), 1); | 157 | QCOMPARE(screensChangedSpy.count(), 1); | ||
156 | QCOMPARE(screens()->count(), 1); | 158 | QCOMPARE(screens()->count(), 1); | ||
157 | QCOMPARE(screens()->geometry(0), geometries2.at(0)); | 159 | QCOMPARE(screens()->geometry(0), geometries2.at(0)); | ||
158 | 160 | | |||
159 | QVERIFY(outputAnnouncedSpy.wait()); | 161 | QVERIFY(outputAnnouncedSpy.wait()); | ||
160 | QCOMPARE(outputAnnouncedSpy.count(), 1); | 162 | QCOMPARE(outputAnnouncedSpy.count(), 1); | ||
Show All 16 Lines |