summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/qwebenginescript
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-08-01 15:04:35 +0200
committerMichal Klocek <michal.klocek@qt.io>2018-08-09 09:39:56 +0000
commitdb62139e1daea171e08d95592c63f663789d6391 (patch)
treeddce513a2e74bf656466a6f83b57a8efbd3cbe18 /tests/auto/widgets/qwebenginescript
parente50fb187dc4467ac28a724e6ea9f2d51a1f131ba (diff)
Make WebChannel an optional feature
Add webengine-webchannel feature. Change-Id: I600572180f8169aafe79cf0408527cc087d9a007 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'tests/auto/widgets/qwebenginescript')
-rw-r--r--tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
index 23d31a478..f4e1baa33 100644
--- a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
+++ b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
@@ -18,14 +18,16 @@
*/
#include <QtTest/QtTest>
-
+#include <QtWebEngineCore/qtwebenginecore-config.h>
#include <qwebenginepage.h>
#include <qwebengineprofile.h>
#include <qwebenginescript.h>
#include <qwebenginescriptcollection.h>
#include <qwebengineview.h>
#include "../util.h"
+#if QT_CONFIG(webengine_webchannel)
#include <QWebChannel>
+#endif
class tst_QWebEngineScript: public QObject {
Q_OBJECT
@@ -35,14 +37,16 @@ private Q_SLOTS:
void loadEvents();
void scriptWorld();
void scriptModifications();
+#if QT_CONFIG(webengine_webchannel)
void webChannel_data();
void webChannel();
- void noTransportWithoutWebChannel();
- void scriptsInNestedIframes();
void webChannelResettingAndUnsetting();
void webChannelWithExistingQtObject();
void navigation();
void webChannelWithBadString();
+#endif
+ void noTransportWithoutWebChannel();
+ void scriptsInNestedIframes();
};
void tst_QWebEngineScript::domEditing()
@@ -273,7 +277,7 @@ static QWebEngineScript webChannelScript()
script.setWorldId(QWebEngineScript::MainWorld);
return script;
}
-
+#if QT_CONFIG(webengine_webchannel)
void tst_QWebEngineScript::webChannel_data()
{
QTest::addColumn<int>("worldId");
@@ -318,7 +322,7 @@ void tst_QWebEngineScript::webChannel()
if (worldId != QWebEngineScript::MainWorld)
QCOMPARE(evaluateJavaScriptSync(&page, "qt.webChannelTransport"), QVariant(QVariant::Invalid));
}
-
+#endif
void tst_QWebEngineScript::noTransportWithoutWebChannel()
{
QWebEnginePage page;
@@ -382,7 +386,7 @@ void tst_QWebEngineScript::scriptsInNestedIframes()
QWebEngineScript::ApplicationWorld),
QVariant::fromValue(QStringLiteral("Modified Inner text")));
}
-
+#if QT_CONFIG(webengine_webchannel)
void tst_QWebEngineScript::webChannelResettingAndUnsetting()
{
QWebEnginePage page;
@@ -485,7 +489,7 @@ void tst_QWebEngineScript::webChannelWithBadString()
QVERIFY(hostSpy.wait(20000));
QCOMPARE(host.text(), QString(QChar(QChar::ReplacementCharacter)));
}
-
+#endif
QTEST_MAIN(tst_QWebEngineScript)
#include "tst_qwebenginescript.moc"