Commit 026d6afb authored by Laurent Montel's avatar Laurent Montel 😁

Add more autotests

parent e82a8a9b
......@@ -18,7 +18,7 @@ ecm_add_test(webengineprintmessageboxtest.cpp
LINK_LIBRARIES Qt5::Test KF5::WebEngineViewer
)
ecm_add_test(webengineexporthtmlpagejobtest.cpp
ecm_add_test(webengineexporthtmlpagejobtest.cpp ../webengineexporthtmlpagejob.cpp
TEST_NAME webengineexporthtmlpagejobtest
NAME_PREFIX "webengineviewer-"
LINK_LIBRARIES Qt5::Test KF5::WebEngineViewer
......
......@@ -16,6 +16,7 @@
*/
#include "webengineexporthtmlpagejobtest.h"
#include "../webengineexporthtmlpagejob.h"
#include <QTest>
WebEngineExportHtmlPageJobTest::WebEngineExportHtmlPageJobTest(QObject *parent)
......@@ -29,4 +30,10 @@ WebEngineExportHtmlPageJobTest::~WebEngineExportHtmlPageJobTest()
}
void WebEngineExportHtmlPageJobTest::shouldHaveDefaultValue()
{
WebEngineViewer::WebEngineExportHtmlPageJob job;
QVERIFY(!job.engineView());
}
QTEST_MAIN(WebEngineExportHtmlPageJobTest)
......@@ -26,6 +26,8 @@ class WebEngineExportHtmlPageJobTest : public QObject
public:
explicit WebEngineExportHtmlPageJobTest(QObject *parent = Q_NULLPTR);
~WebEngineExportHtmlPageJobTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
#endif // WEBENGINEEXPORTHTMLPAGEJOBTEST_H
......@@ -20,7 +20,8 @@
using namespace WebEngineViewer;
WebEngineExportHtmlPageJob::WebEngineExportHtmlPageJob(QObject *parent)
: QObject(parent)
: QObject(parent),
mEngineView(Q_NULLPTR)
{
}
......@@ -29,3 +30,18 @@ WebEngineExportHtmlPageJob::~WebEngineExportHtmlPageJob()
{
}
void WebEngineExportHtmlPageJob::start()
{
}
QWebEngineView *WebEngineExportHtmlPageJob::engineView() const
{
return mEngineView;
}
void WebEngineExportHtmlPageJob::setEngineView(QWebEngineView *engineView)
{
mEngineView = engineView;
}
......@@ -19,6 +19,7 @@
#define WEBENGINEEXPORTHTMLPAGEJOB_H
#include <QObject>
class QWebEngineView;
namespace WebEngineViewer
{
class WebEngineExportHtmlPageJob : public QObject
......@@ -27,6 +28,14 @@ class WebEngineExportHtmlPageJob : public QObject
public:
explicit WebEngineExportHtmlPageJob(QObject *parent = Q_NULLPTR);
~WebEngineExportHtmlPageJob();
void start();
QWebEngineView *engineView() const;
void setEngineView(QWebEngineView *engineView);
private:
QWebEngineView *mEngineView;
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment