Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/screen_changes_test.cpp
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Line(s) | 72 | { | |||
---|---|---|---|---|---|
120 | QCOMPARE(outputRemovedSpy.first().first().value<quint32>(), firstOutputId); | 120 | QCOMPARE(outputRemovedSpy.first().first().value<quint32>(), firstOutputId); | ||
121 | 121 | | |||
122 | // let's wait a little bit to ensure we don't get more events | 122 | // let's wait a little bit to ensure we don't get more events | ||
123 | QTest::qWait(100); | 123 | QTest::qWait(100); | ||
124 | QCOMPARE(outputAnnouncedSpy.count(), 2); | 124 | QCOMPARE(outputAnnouncedSpy.count(), 2); | ||
125 | QCOMPARE(outputRemovedSpy.count(), 1); | 125 | QCOMPARE(outputRemovedSpy.count(), 1); | ||
126 | 126 | | |||
127 | // let's create the output objects to ensure they are correct | 127 | // let's create the output objects to ensure they are correct | ||
128 | QScopedPointer<Output> o1(registry.createOutput(outputAnnouncedSpy.first().first().value<quint32>(), outputAnnouncedSpy.first().last().value<quint32>())); | 128 | QScopedPointer<KWayland::Client::Output> o1(registry.createOutput(outputAnnouncedSpy.first().first().value<quint32>(), outputAnnouncedSpy.first().last().value<quint32>())); | ||
129 | QVERIFY(o1->isValid()); | 129 | QVERIFY(o1->isValid()); | ||
130 | QSignalSpy o1ChangedSpy(o1.data(), &Output::changed); | 130 | QSignalSpy o1ChangedSpy(o1.data(), &KWayland::Client::Output::changed); | ||
131 | QVERIFY(o1ChangedSpy.isValid()); | 131 | QVERIFY(o1ChangedSpy.isValid()); | ||
132 | QVERIFY(o1ChangedSpy.wait()); | 132 | QVERIFY(o1ChangedSpy.wait()); | ||
133 | QCOMPARE(o1->geometry(), geometries.at(0)); | 133 | QCOMPARE(o1->geometry(), geometries.at(0)); | ||
134 | QScopedPointer<Output> o2(registry.createOutput(outputAnnouncedSpy.last().first().value<quint32>(), outputAnnouncedSpy.last().last().value<quint32>())); | 134 | QScopedPointer<KWayland::Client::Output> o2(registry.createOutput(outputAnnouncedSpy.last().first().value<quint32>(), outputAnnouncedSpy.last().last().value<quint32>())); | ||
135 | QVERIFY(o2->isValid()); | 135 | QVERIFY(o2->isValid()); | ||
136 | QSignalSpy o2ChangedSpy(o2.data(), &Output::changed); | 136 | QSignalSpy o2ChangedSpy(o2.data(), &KWayland::Client::Output::changed); | ||
137 | QVERIFY(o2ChangedSpy.isValid()); | 137 | QVERIFY(o2ChangedSpy.isValid()); | ||
138 | QVERIFY(o2ChangedSpy.wait()); | 138 | QVERIFY(o2ChangedSpy.wait()); | ||
139 | QCOMPARE(o2->geometry(), geometries.at(1)); | 139 | QCOMPARE(o2->geometry(), geometries.at(1)); | ||
140 | 140 | | |||
141 | // now let's try to remove one output again | 141 | // now let's try to remove one output again | ||
142 | outputAnnouncedSpy.clear(); | 142 | outputAnnouncedSpy.clear(); | ||
143 | outputRemovedSpy.clear(); | 143 | outputRemovedSpy.clear(); | ||
144 | screensChangedSpy.clear(); | 144 | screensChangedSpy.clear(); | ||
145 | 145 | | |||
146 | QSignalSpy o1RemovedSpy(o1.data(), &Output::removed); | 146 | QSignalSpy o1RemovedSpy(o1.data(), &KWayland::Client::Output::removed); | ||
147 | QVERIFY(o1RemovedSpy.isValid()); | 147 | QVERIFY(o1RemovedSpy.isValid()); | ||
148 | QSignalSpy o2RemovedSpy(o2.data(), &Output::removed); | 148 | QSignalSpy o2RemovedSpy(o2.data(), &KWayland::Client::Output::removed); | ||
149 | QVERIFY(o2RemovedSpy.isValid()); | 149 | QVERIFY(o2RemovedSpy.isValid()); | ||
150 | 150 | | |||
151 | const QVector<QRect> geometries2{QRect(0, 0, 1280, 1024)}; | 151 | const QVector<QRect> geometries2{QRect(0, 0, 1280, 1024)}; | ||
152 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | 152 | QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", | ||
153 | Qt::DirectConnection, | 153 | Qt::DirectConnection, | ||
154 | Q_ARG(int, 1), | 154 | Q_ARG(int, 1), | ||
155 | Q_ARG(QVector<QRect>, geometries2)); | 155 | Q_ARG(QVector<QRect>, geometries2)); | ||
156 | QVERIFY(screensChangedSpy.wait()); | 156 | QVERIFY(screensChangedSpy.wait()); | ||
Show All 22 Lines |