diff options
author | Christian Strømme <christian.stromme@theqtcompany.com> | 2015-06-19 16:14:52 +0200 |
---|---|---|
committer | Christian Stromme <christian.stromme@theqtcompany.com> | 2015-06-22 11:23:06 +0000 |
commit | bec2a48e0159f4b5a5fec0a893d2ed4a161bcf37 (patch) | |
tree | ecf458654dd90600bc32073400091e47c29dfe22 /tests/auto | |
parent | 60ff677f61c525d83a7ce9f380d01e9091f04044 (diff) |
Added a macro to conveniently check and skip tests on Android.
This makes it easier to skip test that won't run on older versions of
Android.
Change-Id: I994b56a5301d5125c1c7df6dd70db947b00d57b6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/webview/qwebview/tst_qwebview.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/webview/qwebview/tst_qwebview.cpp b/tests/auto/webview/qwebview/tst_qwebview.cpp index d0a2329..897b22c 100644 --- a/tests/auto/webview/qwebview/tst_qwebview.cpp +++ b/tests/auto/webview/qwebview/tst_qwebview.cpp @@ -51,6 +51,15 @@ #include <QtWebEngine> #endif // QT_WEBVIEW_WEBENGINE_BACKEND +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) +#include <QtCore/private/qjnihelpers_p.h> +#define ANDROID_REQUIRES_API_LEVEL(N) \ + if (QtAndroidPrivate::androidSdkVersion() < N) \ + QSKIP("This feature is not supported on this version of Android"); +#else +#define ANDROID_REQUIRES_API_LEVEL(N) +#endif + class tst_QWebView : public QObject { Q_OBJECT @@ -104,6 +113,7 @@ void tst_QWebView::load() void tst_QWebView::runJavaScript() { #ifndef QT_NO_QQUICKWEBVIEW_TESTS + ANDROID_REQUIRES_API_LEVEL(19) const QString tstProperty = QString(QLatin1String("Qt.tst_data")); const QString title = QString(QLatin1String("WebViewTitle")); |