Commit graph

13 commits

Author SHA1 Message Date
Roman Gilg
608a89a85b [autotests] Use Xwayland class in WaylandTestApplication
Summary:
By using the new Xwayland class we can reduce code duplication.

An abstract parent class is introduced, that allows interfacing
with the Xwayland class from the test binaries.

Test Plan: Autotests still pass.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15022
2019-02-19 12:18:33 +01:00
Martin Flöser
c2c92fab51 Ensure the Compositor does not start during termination
Summary:
The SceneOpenGLES test was starting to randomly crash on my system. On
investigation I observed that there was a graphics reset ("Attempting to
reset compositing.") which triggered a delayed restart of the
compositor. This even was only processed while waiting for XWayland to
terminate. Which resulted in a crash in KWin::getXServerVersion as the
xcb connection broke.

It makes no sense to setup the compositor again during application
shutdown. Thus the dtors set a flag that they are terminating the
application and Compositor::setup is checking for it.

Test Plan: Test no longer crashes, although it goes through the crashing path

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18015
2019-01-12 07:36:55 +01:00
Martin Flöser
c8ede9a5ff Build platform plugins in correct sub directory of build dir
Summary:
This brings KWin a step closer to be run from build dir without having
to install at all. The integration tests are adjusted so that the
virtual platform is still found which makes the code be closer to what
is used in normal kwin_wayland.

Test Plan: ctest passes, manually verified correct plugin is loaded

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17388
2018-12-13 19:36:28 +01:00
Martin Flöser
260646ed62 Delete kglobalshortcutsrc before executing a test
Summary:
When running the complete test suite the ScriptedEffectsTest::testShortcuts
registers the shortcut meta+shift+y. But GlobalShortcutsTest::testX11ClientShortcut
also tries to use this shortcut for a window shortcut which fails if it
is already registered. So when running the complete test suite it
depends on the order of execution whether the GlobalShortcutsTest passes
or not.

Test should be clean - also the globalshortcuts. As the config is read
from test directory anyway, we can delete the file prior to init of
kglobalaccel.

Test Plan: Run ctest, test did not fail anymore

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16932
2018-12-01 12:13:39 +01:00
Martin Flöser
0e839c4dda Unset XKB_DEFAULT_* in tests to make tests better reproducable
Summary:
On one of my systems XKB_DEFAULT_LAYOUT is set to "de". This makes a few
tests fail, e.g. pointer input and modifier only shortcuts.

The reason is that those tests assume the xkb default layout behavior,
that is how xkb functions without any layout being set. So having the
env variable around influences the layout generation.

To prevent this the environment variables are unset and thus a
reproducable environment is created.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16737
2018-11-07 20:10:58 +01:00
Martin Flöser
e9c72e4e62 [autotests] Set breeze icon theme name in integration tests
This is an attempt to get some tests failing on the CI due to not
finding icons fixed. See T8082
2018-02-27 18:17:53 +01:00
Martin Flöser
1c61e61119 [autotests] Support new way to run the tests without need to install
Summary:
KWin was quite good in ensuring that you don't need to install by
passing paths to the tests. The new way is much nicer, so code is
adjusted for the new way. Also if we require a newer ECM in future we
need to support the new way.

No guarantee that the tests don't pick something up from the system env,
that needs more testing.

References: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled

Test Plan: The tests which loaded helpers pass

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7543
2017-11-21 20:34:52 +01:00
Martin Flöser
d75e5c63d4 Ensure Workspace is only started once in Wayland-only mode
The connect to Compositor::sceneCreated must be disconnected again,
otherwise a restart of the Compositor results in Workspace being created
again.

Thanks to our autotests for finding this problem!
2017-10-01 09:06:51 +02:00
Martin Flöser
2fb5a5fb9f [autotests] Support Wayland Only in addition to XWayland
The integrationTest function takes a new optional argument whether the
test supports a Wayland Only mode. If that's the case the test is
compiled twice, once (as always) as "foo" with XWayland support and
once as "foo_waylandonly" without XWayland support.

This way we can ensure that our code always supports both modes. The
tests found multiple issues. At the moment fast running tests are
sporadically crashing on tear down. This needs further investigation.
2017-09-30 16:35:52 +02:00
Martin Gräßlin
ee7da425ce Unpolish QStyle on QApp prior to destroying internal Wayland connection
Summary:
The QStyle might interact with our internal Wayland connection. If the
cleanup happens after destroying our internal Wayland connection KWin
will crash at tear-down.

With this change the QStyle can perform cleanup already prior to the
deconstruction of the Wayland connection.

CCBUG: 372001

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3241
2016-11-07 11:28:06 +01:00
Martin Gräßlin
03b8477f27 [autotest/integration] Enable test mode for QStandardPaths
By enabling test mode for QStandardPath kglobalaccel doesn't modify the
user's global shortcuts any more.
2016-10-05 13:21:33 +02:00
Martin Gräßlin
2b5747dccb [autotests/integration] Unload effects before destroying Workspace
Brings in line with behavior in main_wayland.cpp and is needed as
effects might call into Workspace during tear down.
2016-07-04 14:37:35 +02:00
Martin Gräßlin
d6dd4af8cf Rename autotests/wayland to autotests/integration
It's not about Wayland, but more about Integration. It can test both
Wayland and X11 windows.

Reviewed-By: Bhushan Shah
2016-06-29 10:29:45 +02:00
Renamed from autotests/wayland/kwin_wayland_test.cpp (Browse further)