Commit 4b2bb9bf authored by Laurent Montel's avatar Laurent Montel 😁

Improve autotests. Add more signals

parent 9b3b17f7
......@@ -17,6 +17,7 @@
#include "webengineexporthtmlpagejobtest.h"
#include "../webengineexporthtmlpagejob.h"
#include <QSignalSpy>
#include <QTest>
WebEngineExportHtmlPageJobTest::WebEngineExportHtmlPageJobTest(QObject *parent)
......@@ -33,7 +34,12 @@ WebEngineExportHtmlPageJobTest::~WebEngineExportHtmlPageJobTest()
void WebEngineExportHtmlPageJobTest::shouldHaveDefaultValue()
{
WebEngineViewer::WebEngineExportHtmlPageJob job;
QSignalSpy spyFailed(&job, SIGNAL(failed()));
QSignalSpy spySuccess(&job, SIGNAL(success(QString)));
QVERIFY(!job.engineView());
job.start();
QCOMPARE(spyFailed.count(), 1);
QCOMPARE(spySuccess.count(), 0);
}
QTEST_MAIN(WebEngineExportHtmlPageJobTest)
......@@ -16,6 +16,7 @@
*/
#include "webengineexporthtmlpagejob.h"
#include "config-webengineviewer.h"
using namespace WebEngineViewer;
......
......@@ -36,6 +36,7 @@ public:
Q_SIGNALS:
void failed();
void success(const QString &filename);
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