Commit 8a5db798 authored by Szabolcs David's avatar Szabolcs David
Browse files

Use the shared waitForSignal method in QQuickWebEngineViewGraphics test


Change-Id: Ie27e4af5f4517bb1e1eea1262ab32140b3dff816
Reviewed-by: default avatarAndras Becsi <andras.becsi@digia.com>
Showing with 2 additions and 15 deletions
......@@ -39,6 +39,8 @@
**
****************************************************************************/
#include "util.h"
#include <QtTest/QtTest>
#include <QQmlContext>
#include <QQuickView>
......@@ -99,21 +101,6 @@ static QImage get150x150GreenReferenceImage()
return reference;
}
static inline bool waitForSignal(QObject *obj, const char *signal, int timeout = 10000)
{
QEventLoop loop;
QObject::connect(obj, signal, &loop, SLOT(quit()));
QTimer timer;
QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
if (timeout > 0) {
QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
timer.setSingleShot(true);
timer.start(timeout);
}
loop.exec();
return timeoutSpy.isEmpty();
}
tst_QQuickWebEngineViewGraphics::tst_QQuickWebEngineViewGraphics()
{
}
......
Supports Markdown
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