Differential D23864 Diff 65833 plugins/messageviewerheaderplugins/autotests/grantleeheaderstyleplugintest.cpp
Changeset View
Changeset View
Standalone View
Standalone View
plugins/messageviewerheaderplugins/autotests/grantleeheaderstyleplugintest.cpp
Show All 18 Lines | |||||
19 | 19 | | |||
20 | #include "grantleeheaderstyleplugintest.h" | 20 | #include "grantleeheaderstyleplugintest.h" | ||
21 | #include "utils.h" | 21 | #include "utils.h" | ||
22 | #include "../grantleeheaderstyleplugin/grantleeheaderstyleplugin.h" | 22 | #include "../grantleeheaderstyleplugin/grantleeheaderstyleplugin.h" | ||
23 | #include "../grantleeheaderstyleplugin/grantleeheaderstyleinterface.h" | 23 | #include "../grantleeheaderstyleplugin/grantleeheaderstyleinterface.h" | ||
24 | 24 | | |||
25 | #include <GrantleeTheme/GrantleeThemeManager> | 25 | #include <GrantleeTheme/GrantleeThemeManager> | ||
26 | #include <MessageViewer/HeaderStyle> | 26 | #include <MessageViewer/HeaderStyle> | ||
27 | #include <MimeTreeParser/NodeHelper> | ||||
27 | 28 | | |||
28 | #include <QTest> | 29 | #include <QTest> | ||
29 | #include <QStandardPaths> | 30 | #include <QStandardPaths> | ||
30 | 31 | | |||
31 | #include <KActionCollection> | 32 | #include <KActionCollection> | ||
32 | #include <KActionMenu> | 33 | #include <KActionMenu> | ||
33 | 34 | | |||
34 | GrantleeHeaderStylePluginTest::GrantleeHeaderStylePluginTest(QObject *parent) | 35 | GrantleeHeaderStylePluginTest::GrantleeHeaderStylePluginTest(QObject *parent) | ||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Line(s) | |||||
152 | void GrantleeHeaderStylePluginTest::testThemeRender() | 153 | void GrantleeHeaderStylePluginTest::testThemeRender() | ||
153 | { | 154 | { | ||
154 | QFETCH(QString, themeName); | 155 | QFETCH(QString, themeName); | ||
155 | QFETCH(QString, mailFileName); | 156 | QFETCH(QString, mailFileName); | ||
156 | 157 | | |||
157 | auto aMsg = readAndParseMail(mailFileName); | 158 | auto aMsg = readAndParseMail(mailFileName); | ||
158 | MessageViewer::GrantleeHeaderStylePlugin plugin; | 159 | MessageViewer::GrantleeHeaderStylePlugin plugin; | ||
159 | auto *style = plugin.headerStyle(); | 160 | auto *style = plugin.headerStyle(); | ||
161 | MimeTreeParser::NodeHelper nodeHelper; | ||||
162 | style->setNodeHelper(&nodeHelper); | ||||
160 | KActionMenu *menu = new KActionMenu(this); | 163 | KActionMenu *menu = new KActionMenu(this); | ||
161 | QActionGroup *act = new QActionGroup(this); | 164 | QActionGroup *act = new QActionGroup(this); | ||
162 | 165 | | |||
163 | MessageViewer::GrantleeHeaderStyleInterface *interface = static_cast<MessageViewer::GrantleeHeaderStyleInterface *>(plugin.createView(menu, act, new KActionCollection(this))); | 166 | MessageViewer::GrantleeHeaderStyleInterface *interface = static_cast<MessageViewer::GrantleeHeaderStyleInterface *>(plugin.createView(menu, act, new KActionCollection(this))); | ||
164 | QVERIFY(interface); | 167 | QVERIFY(interface); | ||
165 | 168 | | |||
166 | QVERIFY(interface->mThemeManager->themes().contains(themeName)); | 169 | QVERIFY(interface->mThemeManager->themes().contains(themeName)); | ||
167 | 170 | | |||
Show All 19 Lines |