From 80dcba46b55d28117314ce59a98e5e64a56d9f4c Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 12 Jul 2016 10:01:29 +0200 Subject: [PATCH] IconItemTest: Set plasma theme to default rather than skipping tests if not default Default plasma theme is installed with plasma-framework, so there shouldn't be reason to skip tests. REVIEW: 128408 --- autotests/iconitemtest.cpp | 30 +++++------------------------- autotests/iconitemtest.h | 1 + 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/autotests/iconitemtest.cpp b/autotests/iconitemtest.cpp index e6bbc669c..0ec4616af 100644 --- a/autotests/iconitemtest.cpp +++ b/autotests/iconitemtest.cpp @@ -92,6 +92,11 @@ void IconItemTest::cleanupTestCase() delete m_view; } +void IconItemTest::init() +{ + Plasma::Theme().setThemeName(QStringLiteral("default")); +} + void IconItemTest::cleanup() { qDeleteAll(m_view->rootObject()->childItems()); @@ -187,11 +192,6 @@ void IconItemTest::invalidIcon() void IconItemTest::usesPlasmaTheme() { - Plasma::Theme theme; - if (!theme.themeName().startsWith("default")) { - QSKIP("Current Plasma theme is not Breeze."); - } - // usesPlasmaTheme = true (default) QQuickItem *item1 = createIconItem(); item1->setProperty("source", "konversation"); @@ -221,11 +221,6 @@ void IconItemTest::usesPlasmaTheme() void IconItemTest::animation() { - if (!Plasma::Theme().themeName().startsWith("default")) { - // This this depends on the production default theme. - QSKIP("Current Plasma theme is not Breeze."); - } - // animated = true (default) QQuickItem *item1 = createIconItem(); item1->setProperty("source", "user-away"); @@ -253,11 +248,6 @@ void IconItemTest::animation() void IconItemTest::animationAfterHide() { - if (!Plasma::Theme().themeName().startsWith("default")) { - // This this depends on the production default theme. - QSKIP("Current Plasma theme is not Breeze."); - } - QQuickItem *item1 = createIconItem(); QQuickItem *item2 = createIconItem(); item1->setProperty("source", "user-away"); @@ -332,11 +322,6 @@ void IconItemTest::loadSvg() void IconItemTest::themeChange() { - if (!Plasma::Theme().themeName().startsWith("default")) { - // This this depends on the production themes (infer their presence from default). - QSKIP("Current Plasma theme is not Breeze."); - } - // Icon from Plasma theme QQuickItem *item1 = createIconItem(); item1->setProperty("animated", false); @@ -383,11 +368,6 @@ void IconItemTest::qiconFromTheme() void IconItemTest::changeColorGroup() { - if (!Plasma::Theme().themeName().startsWith("default")) { - // This this depends on the production default theme. - QSKIP("Current Plasma theme is not Breeze."); - } - // Icon from Plasma theme QQuickItem *item = createIconItem(); item->setProperty("animated", false); diff --git a/autotests/iconitemtest.h b/autotests/iconitemtest.h index e2e05c05b..afa708290 100644 --- a/autotests/iconitemtest.h +++ b/autotests/iconitemtest.h @@ -36,6 +36,7 @@ class IconItemTest : public QObject private Q_SLOTS: void initTestCase(); void cleanupTestCase(); + void init(); void cleanup(); void loadPixmap();