Permalink
Browse files

[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
  • Loading branch information...
1 parent 8073d85 commit eda4f6103707bc425dec884c3fe4dac1077b21a7 @mgraesslin mgraesslin committed Sep 30, 2015
Showing with 18 additions and 0 deletions.
  1. +8 −0 autotests/CMakeLists.txt
  2. +10 −0 autotests/test_screen_edges.cpp
View
@@ -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)
@@ -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;

0 comments on commit eda4f61

Please sign in to comment.