3535
3636#include < iostream>
3737
38+ #ifndef QT_NO_SAMPLES
3839#include " WindowTest.h"
3940#include " ClickTest.h"
4041#include " ElementAttributeTest.h"
6061#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
6162#include " VideoTest.h"
6263extern std::string testDataFolder;
63- #endif // WD_ENABLE_PLAYER
64+ #endif // WD_ENABLE_PLAYER
65+ #endif // QT_NO_SAMPLES
6466
6567#include " base/at_exit.h"
6668#include " webdriver_server.h"
@@ -95,12 +97,15 @@ extern std::string testDataFolder;
9597#include " extension_qt/qwebviewext.h"
9698#include " extension_qt/graphics_web_view_executor.h"
9799#include " extension_qt/graphics_web_view_enumerator.h"
100+
101+ #ifndef QT_NO_SAMPLES
98102#include " GraphicsWebViewTest.h"
99103#include " WindowWithEmbeddedViewTest.h"
100104#include " WidgetAndWebViewTest.h"
101105#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
102106#include " WindowWithSeparatedDeclarativeAndWebViewsTest.h"
103107#endif // QT_VERSION
108+ #endif // QT_NO_SAMPLES
104109#endif // WD_TEST_ENABLE_WEB_VIEW
105110
106111#include " extension_qt/q_view_runner.h"
@@ -112,15 +117,23 @@ extern std::string testDataFolder;
112117#include " extension_qt/vnc_event_dispatcher.h"
113118#include " extension_qt/uinput_event_dispatcher.h"
114119
120+ #ifndef QT_NO_VNC
115121#include " extension_qt/vncclient.h"
122+ #endif // QT_NO_VNC
123+ #ifndef QT_NO_UINPUT
116124#include " extension_qt/uinput_manager.h"
125+ #endif // QT_NO_UINPUT
117126#include " webdriver_switches.h"
118127
119128void setQtSettings ();
120129void PrintVersion ();
121130void PrintHelp ();
131+ #ifndef QT_NO_VNC
122132void InitVNCClient ();
133+ #endif // QT_NO_VNC
134+ #ifndef QT_NO_UINPUT
123135void InitUInputClient ();
136+ #endif // QT_NO_UINPUT
124137
125138int main (int argc, char *argv[])
126139{
@@ -145,6 +158,7 @@ int main(int argc, char *argv[])
145158 Creation can be triggered by client side request like wd.get("qtwidget://WindowTestWidget");
146159 */
147160 widgetCreator->RegisterViewClass <QWidget>(" QWidget" );
161+ #ifndef QT_NO_SAMPLES
148162 widgetCreator->RegisterViewClass <WindowTestWidget>(" WindowTestWidget" );
149163 widgetCreator->RegisterViewClass <ClickTestWidget>(" ClickTestWidget" );
150164 widgetCreator->RegisterViewClass <ElementAttributeTestWidget>(" ElementAttributeTestWidget" );
@@ -169,6 +183,7 @@ int main(int argc, char *argv[])
169183#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
170184 widgetCreator->RegisterViewClass <VideoTestWidget>(" VideoTestWidget" );
171185#endif // WD_ENABLE_PLAYER
186+ #endif // QT_NO_SAMPLES
172187
173188#if (WD_TEST_ENABLE_WEB_VIEW == 1)
174189 /* Configure web views */
@@ -184,6 +199,7 @@ int main(int argc, char *argv[])
184199 webdriver::ViewEnumerator::AddViewEnumeratorImpl (new webdriver::GraphicsWebViewEnumeratorImpl ());
185200 webdriver::ViewCmdExecutorFactory::GetInstance ()->AddViewCmdExecutorCreator (new webdriver::GraphicsWebViewCmdExecutorCreator ());
186201
202+ #ifndef QT_NO_SAMPLES
187203 /* Register som test classes */
188204 widgetCreator->RegisterViewClass <GraphicsWebViewTestWindows>(" GraphicsWebViewTestWindows" );
189205 widgetCreator->RegisterViewClass <WindowWithEmbeddedViewTestWidget>(" WindowWithEmbeddedViewTestWidget" );
@@ -193,6 +209,7 @@ int main(int argc, char *argv[])
193209#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
194210 widgetCreator->RegisterViewClass <WindowWithSeparatedDeclarativeAndWebViewsTestWidget>(" WindowWithSeparatedDeclarativeAndWebViewsTestWidget" );
195211#endif // QT_VERSION
212+ #endif // QT_NO_SAMPLES
196213#endif // WD_TEST_ENABLE_WEB_VIEW
197214
198215#ifndef QT_NO_QML
@@ -253,6 +270,7 @@ int main(int argc, char *argv[])
253270 return 0 ;
254271 }
255272
273+ #ifndef QT_NO_SAMPLES
256274#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
257275 // check if --test_data_folder CL argument is present
258276 std::string testDataFolderSwitch = " test_data_folder" ;
@@ -264,7 +282,8 @@ int main(int argc, char *argv[])
264282 }
265283
266284 std::cout << " Using " << testDataFolder << " as test data folder" << std::endl;
267- #endif // WD_ENABLE_PLAYER
285+ #endif // WD_ENABLE_PLAYER
286+ #endif // QT_NO_SAMPLES
268287
269288#if defined(OS_WIN)
270289#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
@@ -324,6 +343,7 @@ void setQtSettings() {
324343#endif
325344}
326345
346+ #ifndef QT_NO_VNC
327347void InitVNCClient () {
328348 // start VNC module
329349 CommandLine cmdLine = webdriver::Server::GetInstance ()->GetCommandLine ();
@@ -349,7 +369,9 @@ void InitVNCClient() {
349369 WDEventDispatcher::getInstance ()->add (new VNCEventDispatcher (client));
350370 }
351371}
372+ #endif // QT_NO_VNC
352373
374+ #ifndef QT_NO_UINPUT
353375void InitUInputClient () {
354376 // start user input device
355377#ifdef OS_LINUX
@@ -366,6 +388,7 @@ void InitUInputClient() {
366388 }
367389#endif // OS_LINUX
368390}
391+ #endif // QT_NO_UINPUT
369392
370393void PrintVersion () {
371394 std::cout <<webdriver::VersionInfo::CreateVersionString ()<< std::endl;
0 commit comments