[autotests] Test creating core context profile

Extends OpenGL testRestart to once with GLCore and once with legacy.
This commit is contained in:
Martin Flöser 2017-06-25 09:48:46 +02:00
parent a4d401c028
commit 004c0f3892
2 changed files with 16 additions and 0 deletions

View file

@ -80,9 +80,24 @@ void GenericSceneOpenGLTest::initTestCase()
QVERIFY(Compositor::self()); QVERIFY(Compositor::self());
} }
void GenericSceneOpenGLTest::testRestart_data()
{
QTest::addColumn<bool>("core");
QTest::newRow("GLCore") << true;
QTest::newRow("Legacy") << false;
}
void GenericSceneOpenGLTest::testRestart() void GenericSceneOpenGLTest::testRestart()
{ {
// simple restart of the OpenGL compositor without any windows being shown // simple restart of the OpenGL compositor without any windows being shown
// setup opengl compositing options
auto compositingGroup = kwinApp()->config()->group("Compositing");
QFETCH(bool, core);
compositingGroup.writeEntry("GLCore", core);
compositingGroup.sync();
QSignalSpy sceneCreatedSpy(KWin::Compositor::self(), &Compositor::sceneCreated); QSignalSpy sceneCreatedSpy(KWin::Compositor::self(), &Compositor::sceneCreated);
QVERIFY(sceneCreatedSpy.isValid()); QVERIFY(sceneCreatedSpy.isValid());
KWin::Compositor::self()->slotReinitialize(); KWin::Compositor::self()->slotReinitialize();

View file

@ -32,6 +32,7 @@ protected:
private Q_SLOTS: private Q_SLOTS:
void initTestCase(); void initTestCase();
void cleanup(); void cleanup();
void testRestart_data();
void testRestart(); void testRestart();
private: private: