Commit 7d2ad8ca authored by David Faure's avatar David Faure
Browse files

[autotests] more work towards stable autotests

parent 66262c2a
...@@ -41,6 +41,12 @@ TemplateParserJobTest::TemplateParserJobTest(QObject *parent) ...@@ -41,6 +41,12 @@ TemplateParserJobTest::TemplateParserJobTest(QObject *parent)
} }
TemplateParserJobTest::~TemplateParserJobTest()
{
// Workaround QTestLib not flushing deleteLater()s on exit, which leads to WebEngine asserts (view not deleted)
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
}
#if 0 #if 0
void TemplateParserJobTest::test_convertedHtml_data() void TemplateParserJobTest::test_convertedHtml_data()
{ {
......
...@@ -27,7 +27,7 @@ class TemplateParserJobTest : public QObject ...@@ -27,7 +27,7 @@ class TemplateParserJobTest : public QObject
Q_OBJECT Q_OBJECT
public: public:
explicit TemplateParserJobTest(QObject *parent = nullptr); explicit TemplateParserJobTest(QObject *parent = nullptr);
~TemplateParserJobTest() = default; ~TemplateParserJobTest();
private Q_SLOTS: private Q_SLOTS:
/** /**
* checks whether text/plain only mails are converted to a valid HTML * checks whether text/plain only mails are converted to a valid HTML
......
...@@ -65,6 +65,7 @@ void FindBarBaseTest::shouldClearLineWhenClose() ...@@ -65,6 +65,7 @@ void FindBarBaseTest::shouldClearLineWhenClose()
{ {
WebEngineViewer::FindBarBase bar; WebEngineViewer::FindBarBase bar;
bar.show(); bar.show();
QApplication::setActiveWindow(&bar);
QSignalSpy spy(&bar, &WebEngineViewer::FindBarBase::hideFindBar); QSignalSpy spy(&bar, &WebEngineViewer::FindBarBase::hideFindBar);
QTest::qWaitForWindowExposed(&bar); QTest::qWaitForWindowExposed(&bar);
QVERIFY(bar.isVisible()); QVERIFY(bar.isVisible());
...@@ -83,6 +84,7 @@ void FindBarBaseTest::shouldEnableDisableNextPreviousButton() ...@@ -83,6 +84,7 @@ void FindBarBaseTest::shouldEnableDisableNextPreviousButton()
{ {
WebEngineViewer::FindBarBase bar; WebEngineViewer::FindBarBase bar;
bar.show(); bar.show();
QApplication::setActiveWindow(&bar);
QTest::qWaitForWindowExposed(&bar); QTest::qWaitForWindowExposed(&bar);
QPushButton *previous = bar.findChild<QPushButton *>(QStringLiteral("findprevious")); QPushButton *previous = bar.findChild<QPushButton *>(QStringLiteral("findprevious"));
......
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