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

Improve autotests. Add more signals

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