RFC: A Wayland virtual framebuffer server for our tests

Martin Graesslin mgraesslin at kde.org
Fri Apr 15 06:49:14 UTC 2016


Hi Plasmates,

this week I spent some thoughts on how we can do something like Xvfb with 
Wayland. The reasoning is simple: we need to run our test cases also on 
Wayland and not just on X11. Currently something like this doesn't really 
exist so we might need to write it. I have a few ideas how it could be done 
and want to get a discussion started on that.

== Option 1: "Kvfb" based on KWayland ==

A very minimalistic wayland compositor gets written with KWayland which 
"renders". The server would be comparable minimal to Xvfb, that is it doesn't 
have a window manager, it could only map surfaces, there is no policy how to 
pass input events, etc.

Pro: once KWayland is in frameworks we can use that easily in all frameworks 
and applications.

Con: without the policies of a window manager also pretty useless for anything 
more complex than showing a window. Xvfb without a window manager is also 
useless.

== Option 2: Make KWin's test framework available as a library ==

KWin's internal test framework is pretty neat. It starts a new KWin instance 
in each run, can create Wayland and X11 windows. Has full introspection on 
those windows, can fake input events, etc. etc.

This would need to be wrapped in a nice library so that it doesn't expose the 
changing KWin internals. It could allow to e.g. verify in plasmashell that a 
Panel is created on the compositor with the window type Panel, that the struts 
are set properly. It could be used to verify the actual positions of the 
opened windows when clicking panels. And in addition one could do reference 
screenshots.

As a nice side effect it would not only test the tested code, but also KWin.

Pro: very powerful

Con: in process and requires KWin's QPA plugin. No chance to run the tests on 
X11, we are not able to catch problems in Qt's xcb and wayland plugins. Cannot 
be used in Frameworks/Applications.

== Option 3: A virtual framebuffer server based on KWin ==

This is a combination of Option 1 and Option 2: we build a dedicated test 
server on top of KWin's test framework and provide a library to interact with 
it. The test server is a dedicated process, such we don't have the in-process 
problem of Option 2. The tests could use the normal QPA plugin - in fact could 
even be run twice: once on Wayland and once on X11.

To make use of the full power of KWin we would need a library to interact with 
the test server. E.g. we need to be able to fake input events, we need to be 
able to fake screen changes and we want the introspection on the created 
windows. The library part and the test server could communicate through DBus. 
Thus we would have a kind of debug dbus interface in the server exposing all 
the windows with all their properties. On the server side that's not really a 
complex task as we have most things anyway exposed as properties.

Pros: very powerful, allows both X11 and Wayland for testing

Con: most complex architecture to implement. Cannot be used in Frameworks/
Applications.

---

So what do you think? What do you need for testing from the test windowing 
system? Which option should we go for?

I'm not telling you my personal opinion on what's best, don't want to influence 
you.

Cheers
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160415/db7ee875/attachment.sig>


More information about the Plasma-devel mailing list