summaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/shared/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/shared/util.h')
-rw-r--r--tests/auto/quick/shared/util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/quick/shared/util.h b/tests/auto/quick/shared/util.h
index c2e7d3e19..bc5ae445b 100644
--- a/tests/auto/quick/shared/util.h
+++ b/tests/auto/quick/shared/util.h
@@ -36,6 +36,7 @@
#include <QtTest/QtTest>
#include <QtWebEngine/private/qquickwebengineview_p.h>
#include <QtWebEngine/private/qquickwebengineloadrequest_p.h>
+#include <QGuiApplication>
#if !defined(TESTS_SOURCE_DIR)
#define TESTS_SOURCE_DIR ""
@@ -182,4 +183,15 @@ inline QString activeElementId(QQuickWebEngineView *webEngineView)
return arguments.at(1).toString();
}
+#define W_QTEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+ QtWebEngine::initialize(); \
+ QGuiApplication app(argc, argv); \
+ app.setAttribute(Qt::AA_Use96Dpi, true); \
+ TestObject tc; \
+ QTEST_SET_MAIN_SOURCE_PATH \
+ return QTest::qExec(&tc, argc, argv); \
+}
#endif /* UTIL_H */
+