From db62139e1daea171e08d95592c63f663789d6391 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 1 Aug 2018 15:04:35 +0200 Subject: Make WebChannel an optional feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add webengine-webchannel feature. Change-Id: I600572180f8169aafe79cf0408527cc087d9a007 Reviewed-by: Jüri Valdmann --- .../widgets/qwebenginescript/tst_qwebenginescript.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'tests/auto/widgets/qwebenginescript') 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 - +#include #include #include #include #include #include #include "../util.h" +#if QT_CONFIG(webengine_webchannel) #include +#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("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" -- cgit v1.2.3