diff --git a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp index 440660da4f..dda7e59dfc 100644 --- a/autotests/integration/dont_crash_aurorae_destroy_deco.cpp +++ b/autotests/integration/dont_crash_aurorae_destroy_deco.cpp @@ -20,11 +20,13 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "platform.h" #include "client.h" +#include "composite.h" #include "cursor.h" #include "screenedge.h" #include "screens.h" #include "wayland_server.h" #include "workspace.h" +#include "scene.h" #include "shell_client.h" #include @@ -51,9 +53,6 @@ private Q_SLOTS: void DontCrashAuroraeDestroyDecoTest::initTestCase() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); qRegisterMetaType(); qRegisterMetaType(); @@ -77,6 +76,10 @@ void DontCrashAuroraeDestroyDecoTest::initTestCase() QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void DontCrashAuroraeDestroyDecoTest::init() diff --git a/autotests/integration/dont_crash_empty_deco.cpp b/autotests/integration/dont_crash_empty_deco.cpp index d800ef13bf..52f1a58053 100644 --- a/autotests/integration/dont_crash_empty_deco.cpp +++ b/autotests/integration/dont_crash_empty_deco.cpp @@ -20,7 +20,9 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "platform.h" #include "client.h" +#include "composite.h" #include "cursor.h" +#include "scene.h" #include "screenedge.h" #include "screens.h" #include "wayland_server.h" @@ -48,9 +50,6 @@ private Q_SLOTS: void DontCrashEmptyDecorationTest::initTestCase() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -68,6 +67,10 @@ void DontCrashEmptyDecorationTest::initTestCase() QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void DontCrashEmptyDecorationTest::init() diff --git a/autotests/integration/dont_crash_no_border.cpp b/autotests/integration/dont_crash_no_border.cpp index e08d6b3aa3..d7435bacc6 100644 --- a/autotests/integration/dont_crash_no_border.cpp +++ b/autotests/integration/dont_crash_no_border.cpp @@ -21,7 +21,9 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "platform.h" #include "client.h" +#include "composite.h" #include "cursor.h" +#include "scene.h" #include "screenedge.h" #include "screens.h" #include "wayland_server.h" @@ -55,9 +57,6 @@ private Q_SLOTS: void DontCrashNoBorder::initTestCase() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -80,6 +79,10 @@ void DontCrashNoBorder::initTestCase() QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void DontCrashNoBorder::init() diff --git a/autotests/integration/dont_crash_reinitialize_compositor.cpp b/autotests/integration/dont_crash_reinitialize_compositor.cpp index c5fda6ca4a..38f0269c33 100644 --- a/autotests/integration/dont_crash_reinitialize_compositor.cpp +++ b/autotests/integration/dont_crash_reinitialize_compositor.cpp @@ -86,6 +86,10 @@ void DontCrashReinitializeCompositorTest::initTestCase() QCOMPARE(screens()->geometry(0), QRect(0, 0, 1280, 1024)); QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void DontCrashReinitializeCompositorTest::init() diff --git a/autotests/integration/effects/scripted_effects_test.cpp b/autotests/integration/effects/scripted_effects_test.cpp index 919ba1f837..22d36c0c8f 100644 --- a/autotests/integration/effects/scripted_effects_test.cpp +++ b/autotests/integration/effects/scripted_effects_test.cpp @@ -170,6 +170,10 @@ void ScriptedEffectsTest::initTestCase() QVERIFY(workspaceCreatedSpy.wait()); QVERIFY(Compositor::self()); + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); + KWin::VirtualDesktopManager::self()->setCount(2); } diff --git a/autotests/integration/effects/slidingpopups_test.cpp b/autotests/integration/effects/slidingpopups_test.cpp index 3902c07ea5..9d578a34ca 100644 --- a/autotests/integration/effects/slidingpopups_test.cpp +++ b/autotests/integration/effects/slidingpopups_test.cpp @@ -25,6 +25,7 @@ along with this program. If not, see . #include "effectloader.h" #include "cursor.h" #include "platform.h" +#include "scene.h" #include "shell_client.h" #include "wayland_server.h" #include "workspace.h" @@ -86,13 +87,15 @@ void SlidingPopupsTest::initTestCase() config->sync(); kwinApp()->setConfig(config); - if (QFile::exists(QStringLiteral("/dev/dri/card0"))) { - qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); - } + qputenv("KWIN_COMPOSE", QByteArrayLiteral("O2")); qputenv("KWIN_EFFECTS_FORCE_ANIMATIONS", "1"); kwinApp()->start(); QVERIFY(workspaceCreatedSpy.wait()); QVERIFY(Compositor::self()); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void SlidingPopupsTest::init() diff --git a/autotests/integration/effects/toplevel_open_close_animation_test.cpp b/autotests/integration/effects/toplevel_open_close_animation_test.cpp index 0fe95c65c7..bcb8898bed 100644 --- a/autotests/integration/effects/toplevel_open_close_animation_test.cpp +++ b/autotests/integration/effects/toplevel_open_close_animation_test.cpp @@ -21,10 +21,12 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "abstract_client.h" +#include "composite.h" #include "deleted.h" #include "effectloader.h" #include "effects.h" #include "platform.h" +#include "scene.h" #include "shell_client.h" #include "wayland_server.h" #include "workspace.h" @@ -81,6 +83,10 @@ void ToplevelOpenCloseAnimationTest::initTestCase() kwinApp()->start(); QVERIFY(workspaceCreatedSpy.wait()); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void ToplevelOpenCloseAnimationTest::init() diff --git a/autotests/integration/effects/wobbly_shade_test.cpp b/autotests/integration/effects/wobbly_shade_test.cpp index 5693da3793..f259e76cf7 100644 --- a/autotests/integration/effects/wobbly_shade_test.cpp +++ b/autotests/integration/effects/wobbly_shade_test.cpp @@ -82,6 +82,10 @@ void WobblyWindowsShadeTest::initTestCase() kwinApp()->start(); QVERIFY(workspaceCreatedSpy.wait()); QVERIFY(Compositor::self()); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void WobblyWindowsShadeTest::init() diff --git a/autotests/integration/generic_scene_opengl_test.cpp b/autotests/integration/generic_scene_opengl_test.cpp index f5560173e3..ff13007b89 100644 --- a/autotests/integration/generic_scene_opengl_test.cpp +++ b/autotests/integration/generic_scene_opengl_test.cpp @@ -49,9 +49,6 @@ void GenericSceneOpenGLTest::cleanup() void GenericSceneOpenGLTest::initTestCase() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -78,6 +75,10 @@ void GenericSceneOpenGLTest::initTestCase() kwinApp()->start(); QVERIFY(workspaceCreatedSpy.wait()); QVERIFY(Compositor::self()); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void GenericSceneOpenGLTest::testRestart_data() diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp index 932ba41a39..04a87d9ad1 100644 --- a/autotests/integration/lockscreen.cpp +++ b/autotests/integration/lockscreen.cpp @@ -20,7 +20,9 @@ along with this program. If not, see . #include "kwin_wayland_test.h" #include "platform.h" #include "abstract_client.h" +#include "composite.h" #include "cursor.h" +#include "scene.h" #include "screenedge.h" #include "screens.h" #include "wayland_server.h" @@ -182,9 +184,6 @@ AbstractClient *LockScreenTest::showWindow() void LockScreenTest::initTestCase() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -201,6 +200,10 @@ void LockScreenTest::initTestCase() QCOMPARE(screens()->geometry(1), QRect(1280, 0, 1280, 1024)); setenv("QT_QPA_PLATFORM", "wayland", true); waylandServer()->initWorkspace(); + + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); } void LockScreenTest::init() diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp index 3cc9273691..74e529c2eb 100644 --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -302,9 +302,6 @@ void PlasmaWindowTest::testPopupWindowNoPlasmaWindow() void PlasmaWindowTest::testLockScreenNoPlasmaWindow() { - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } // this test verifies that lock screen windows are not exposed to PlasmaWindow QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated); QVERIFY(plasmaWindowCreatedSpy.isValid()); diff --git a/autotests/integration/scene_opengl_shadow_test.cpp b/autotests/integration/scene_opengl_shadow_test.cpp index 79dd96fc43..3702868ee9 100644 --- a/autotests/integration/scene_opengl_shadow_test.cpp +++ b/autotests/integration/scene_opengl_shadow_test.cpp @@ -113,9 +113,6 @@ void SceneOpenGLShadowTest::initTestCase() { // Copied from generic_scene_opengl_test.cpp - if (!QFile::exists(QStringLiteral("/dev/dri/card0"))) { - QSKIP("Needs a dri device"); - } qRegisterMetaType(); qRegisterMetaType(); QSignalSpy workspaceCreatedSpy(kwinApp(), &Application::workspaceCreated); @@ -154,6 +151,10 @@ void SceneOpenGLShadowTest::initTestCase() group.sync(); Workspace::self()->slotReconfigure(); + auto scene = KWin::Compositor::self()->scene(); + QVERIFY(scene); + QCOMPARE(scene->compositingType(), KWin::OpenGL2Compositing); + } void SceneOpenGLShadowTest::cleanup()