autotests/xdgshellwindow: remove timeout for outputEnteredSpy
The timeout makes the test fail wrongly sometimes and isn't needed. Instead assume the window always gets placed on the first output
This commit is contained in:
parent
ba0799974e
commit
245eb822c7
1 changed files with 5 additions and 9 deletions
|
@ -303,20 +303,16 @@ void TestXdgShellWindow::testWindowOutputs()
|
||||||
QSignalSpy outputLeftSpy(surface.get(), &KWayland::Client::Surface::outputLeft);
|
QSignalSpy outputLeftSpy(surface.get(), &KWayland::Client::Surface::outputLeft);
|
||||||
|
|
||||||
auto window = Test::renderAndWaitForShown(surface.get(), size, Qt::blue);
|
auto window = Test::renderAndWaitForShown(surface.get(), size, Qt::blue);
|
||||||
// move to be in the first screen
|
// assumption: window is initially placed on first screen
|
||||||
window->moveResize(QRect(QPoint(100, 100), size));
|
QVERIFY(outputEnteredSpy.wait());
|
||||||
// we don't don't know where the compositor first placed this window,
|
QCOMPARE(outputEnteredSpy.count(), 1);
|
||||||
// this might fire, it might not
|
|
||||||
outputEnteredSpy.wait(5);
|
|
||||||
outputEnteredSpy.clear();
|
|
||||||
|
|
||||||
QCOMPARE(surface->outputs().count(), 1);
|
QCOMPARE(surface->outputs().count(), 1);
|
||||||
QCOMPARE(surface->outputs().first()->globalPosition(), QPoint(0, 0));
|
QCOMPARE(surface->outputs().first()->globalPosition(), QPoint(0, 0));
|
||||||
|
|
||||||
// move to overlapping both first and second screen
|
// move to overlapping both first and second screen
|
||||||
window->moveResize(QRect(QPoint(1250, 100), size));
|
window->moveResize(QRect(QPoint(1250, 100), size));
|
||||||
QVERIFY(outputEnteredSpy.wait());
|
QVERIFY(outputEnteredSpy.wait());
|
||||||
QCOMPARE(outputEnteredSpy.count(), 1);
|
QCOMPARE(outputEnteredSpy.count(), 2);
|
||||||
QCOMPARE(outputLeftSpy.count(), 0);
|
QCOMPARE(outputLeftSpy.count(), 0);
|
||||||
QCOMPARE(surface->outputs().count(), 2);
|
QCOMPARE(surface->outputs().count(), 2);
|
||||||
QVERIFY(surface->outputs()[0] != surface->outputs()[1]);
|
QVERIFY(surface->outputs()[0] != surface->outputs()[1]);
|
||||||
|
@ -324,7 +320,7 @@ void TestXdgShellWindow::testWindowOutputs()
|
||||||
// move entirely into second screen
|
// move entirely into second screen
|
||||||
window->moveResize(QRect(QPoint(1400, 100), size));
|
window->moveResize(QRect(QPoint(1400, 100), size));
|
||||||
QVERIFY(outputLeftSpy.wait());
|
QVERIFY(outputLeftSpy.wait());
|
||||||
QCOMPARE(outputEnteredSpy.count(), 1);
|
QCOMPARE(outputEnteredSpy.count(), 2);
|
||||||
QCOMPARE(outputLeftSpy.count(), 1);
|
QCOMPARE(outputLeftSpy.count(), 1);
|
||||||
QCOMPARE(surface->outputs().count(), 1);
|
QCOMPARE(surface->outputs().count(), 1);
|
||||||
QCOMPARE(surface->outputs().first()->globalPosition(), QPoint(1280, 0));
|
QCOMPARE(surface->outputs().first()->globalPosition(), QPoint(1280, 0));
|
||||||
|
|
Loading…
Reference in a new issue