[autotest] Add workaround for broken no-XRandr in screen edge test

With Qt 5.5 the physicalSize of a screen is broken if the X system does
not provide the XRandR extension. This caused our screen edge test to
fail on the CI system (Xvfb) due to approach window being based on the
dpi.

The problem itself is addressed for Qt in:
https://codereview.qt-project.org/126808

This change just worksaround till the change has made it into our CI
system (at which point the expected fails will break).

Reviewed-By: David Edmundson
icc-effect-5.14.5
Martin Gräßlin 2015-09-30 15:06:01 +02:00
parent 8073d851c4
commit eda4f61037
2 changed files with 18 additions and 0 deletions

View File

@ -270,6 +270,7 @@ set( testScreenEdges_SRCS
../screens.cpp
../screenedge.cpp
../virtualdesktops.cpp
../xcbutils.cpp # init of extensions
)
kconfig_add_kcfg_files(testScreenEdges_SRCS ../settings.kcfgc)
qt5_add_dbus_interface( testScreenEdges_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../org.freedesktop.ScreenSaver.xml screenlocker_interface)
@ -286,6 +287,13 @@ target_link_libraries(testScreenEdges
KF5::GlobalAccel
KF5::WindowSystem
XCB::XCB
XCB::RANDR
XCB::XFIXES
XCB::SYNC
XCB::COMPOSITE
XCB::DAMAGE
XCB::GLX
XCB::SHM
)
add_test(kwin_testScreenEdges testScreenEdges)

View File

@ -305,6 +305,11 @@ void TestScreenEdges::testCreatingInitialEdges()
// approach windows for edges not created as screen too small
s->updateLayout();
auto edgeWindows = s->windows();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
if (!Xcb::Extensions::self()->isRandrAvailable()) {
QEXPECT_FAIL("", "Broken on no xrandr systems in Qt 5.5", Abort);
}
#endif
QCOMPARE(edgeWindows.size(), 12);
auto testWindowGeometry = [&](int index) {
@ -423,6 +428,11 @@ void TestScreenEdges::testCallback()
auto it = std::find_if(edges.constBegin(), edges.constEnd(), [](Edge *e) {
return e->isScreenEdge() && e->isLeft() && e->approachGeometry().bottom() < 768;
});
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
if (!Xcb::Extensions::self()->isRandrAvailable()) {
QEXPECT_FAIL("", "Broken on no xrandr systems in Qt 5.5", Abort);
}
#endif
QVERIFY(it != edges.constEnd());
xcb_enter_notify_event_t event;