summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-10-18 12:49:06 +0200
committerMontel Laurent <[email protected]>2015-10-18 12:49:06 +0200
commitea1ff639df57b84b6415f52fdc0fd59ebfe54d31 (patch)
tree2c38e295e33a90c4c1fda7dea23d00245f851820
parent6ff7a360f9a5f85b50baa89253798382245f3549 (diff)
Reactivate autotests
-rw-r--r--messagecomposer/autotests/maintextjobtest.cpp31
1 files changed, 13 insertions, 18 deletions
diff --git a/messagecomposer/autotests/maintextjobtest.cpp b/messagecomposer/autotests/maintextjobtest.cpp
index 814c941..f1b2664 100644
--- a/messagecomposer/autotests/maintextjobtest.cpp
+++ b/messagecomposer/autotests/maintextjobtest.cpp
@@ -33,8 +33,8 @@ using namespace KMime;
#include <MessageComposer/MainTextJob>
#include <MessageComposer/TextPart>
#include <MessageComposer/RichTextComposerNg>
-//#include <MessageComposer/RichTextComposerImages>
-//#include <MessageComposer/RichTextComposerControler>
+#include <KPIMTextEdit/RichTextComposerControler>
+#include <KPIMTextEdit/RichTextComposerImages>
#include <KActionCollection>
@@ -168,11 +168,11 @@ void MainTextJobTest::testFallbackCharset()
void MainTextJobTest::testHtml()
{
-#if 0 //FIXME REACTIVATE IT
QLatin1String originalHtml("<html><head></head><body>Test <em>with</em> formatting...<br>The end.</body></html>");
- KPIMTextEdit::TextEdit editor;
+ MessageComposer::RichTextComposerNg editor;
+ editor.createActions(new KActionCollection(this));
editor.setTextOrHtml(originalHtml);
- QVERIFY(editor.isFormattingUsed());
+ QVERIFY(editor.composerControler()->isFormattingUsed());
Composer *composer = new Composer;
composer->globalPart()->setGuiEnabled(false);
@@ -208,27 +208,23 @@ void MainTextJobTest::testHtml()
QCOMPARE(QLatin1String(html->body()), editor.toCleanHtml());
}
}
-#endif
}
void MainTextJobTest::testHtmlWithImages()
{
-#if 0 //FIXME REACTIVATE IT
KActionCollection ac(this);
- MessageComposer::RichTextComposerNg richTextcomposer;
- KPIMTextEdit::RichTextComposerControler controler(&richTextcomposer);
- richTextcomposer.createActions(&ac);
+ MessageComposer::RichTextComposerNg editor;
+ editor.createActions(new KActionCollection(this));
- KPIMTextEdit::TextEdit editor;
QString image1 = KIconLoader::global()->iconPath(QLatin1String("folder-new"), KIconLoader::Small, false);
QString image2 = KIconLoader::global()->iconPath(QLatin1String("message"), KIconLoader::Small, false);
QString data = QStringLiteral("dust in the wind");
editor.setTextOrHtml(data);
- editor.addImage(QUrl::fromLocalFile(image1));
- controler.composerImages()->addImage(QUrl::fromLocalFile(image1));
- editor.addImage(QUrl::fromLocalFile(image2));
- controler.composerImages()->addImage(QUrl::fromLocalFile(image2));
- MessageComposer::ImageList images = controler.composerImages()->embeddedImages();
+ editor.composerControler()->composerImages()->addImage(QUrl::fromLocalFile(image1));
+ editor.composerControler()->composerImages()->addImage(QUrl::fromLocalFile(image1));
+ editor.composerControler()->composerImages()->addImage(QUrl::fromLocalFile(image2));
+ editor.composerControler()->composerImages()->addImage(QUrl::fromLocalFile(image2));
+ KPIMTextEdit::ImageList images = editor.composerControler()->composerImages()->embeddedImages();
QCOMPARE(images.count(), 2);
QString cid1 = images[0]->contentID;
QString cid2 = images[1]->contentID;
@@ -242,7 +238,7 @@ void MainTextJobTest::testHtmlWithImages()
textPart->setWordWrappingEnabled(false);
textPart->setCleanPlainText(editor.toCleanPlainText());
textPart->setCleanHtml(editor.toCleanHtml());
- textPart->setEmbeddedImages(controler.composerImages()->embeddedImages());
+ textPart->setEmbeddedImages(editor.composerControler()->composerImages()->embeddedImages());
MainTextJob *mjob = new MainTextJob(textPart, composer);
QVERIFY(mjob->exec());
Content *result = mjob->content();
@@ -299,6 +295,5 @@ void MainTextJobTest::testHtmlWithImages()
QCOMPARE(cid->identifier(), cid2.toLatin1());
}
}
-#endif
}