1616
1717#include < iostream>
1818
19- #include " TestVariables.h"
20- std::string tests::testDataFolder;
21-
22-
2319#include " WindowTest.h"
2420#include " ClickTest.h"
2521#include " ElementAttributeTest.h"
@@ -42,10 +38,10 @@ std::string tests::testDataFolder;
4238#include " WindowWithDeclarativeViewTest.h"
4339#endif
4440
45- // Commented VideoTest due to error https://bugreports.qt-project.org/browse/QTBUG-32949
4641#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
4742#include " VideoTest.h"
48- #endif // WD_ENABLE_PLAYER
43+ extern std::string testDataFolder;
44+ #endif // WD_ENABLE_PLAYER
4945
5046#include " base/at_exit.h"
5147#include " webdriver_server.h"
@@ -55,7 +51,6 @@ std::string tests::testDataFolder;
5551#include " shutdown_command.h"
5652#include " webdriver_route_patterns.h"
5753
58- #ifndef OS_IOS
5954#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
6055 // headers for Quick2 extension
6156 #include " extension_qt/quick2_view_creator.h"
@@ -67,13 +62,12 @@ std::string tests::testDataFolder;
6762 #include " extension_qt/qml_view_creator.h"
6863 #include " extension_qt/qml_view_executor.h"
6964 #include " extension_qt/qml_view_enumerator.h"
70- #if (WD_TEST_ENABLE_WEB_VIEW == 1)
71- #include " extension_qt/qdeclarativewebview.h"
72- #include " extension_qt/qml_web_view_enumerator.h"
73- #include " extension_qt/qml_web_view_executor.h"
74- #endif
75- #endif
76- #endif // OS_IOS
65+ #if (WD_TEST_ENABLE_WEB_VIEW == 1)
66+ #include " extension_qt/qdeclarativewebview.h"
67+ #include " extension_qt/qml_web_view_enumerator.h"
68+ #include " extension_qt/qml_web_view_executor.h"
69+ #endif // WD_TEST_ENABLE_WEB_VIEW
70+ #endif // QT_VERSION
7771
7872#if (WD_TEST_ENABLE_WEB_VIEW == 1)
7973#include " extension_qt/web_view_creator.h"
@@ -87,8 +81,8 @@ std::string tests::testDataFolder;
8781#include " WidgetAndWebViewTest.h"
8882#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
8983#include " WindowWithSeparatedDeclarativeAndWebViewsTest.h"
90- #endif
91- #endif
84+ #endif // QT_VERSION
85+ #endif // WD_TEST_ENABLE_WEB_VIEW
9286
9387#include " extension_qt/q_view_runner.h"
9488#include " extension_qt/q_session_lifecycle_actions.h"
@@ -171,10 +165,9 @@ int main(int argc, char *argv[])
171165
172166#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
173167 widgetCreator->RegisterViewClass <WindowWithSeparatedDeclarativeAndWebViewsTestWidget>(" WindowWithSeparatedDeclarativeAndWebViewsTestWidget" );
174- #endif
175- #endif
168+ #endif // QT_VERSION
169+ #endif // WD_TEST_ENABLE_WEB_VIEW
176170
177- #ifndef OS_IOS
178171#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
179172 // Quick2 extension
180173 webdriver::ViewCreator* qmlCreator = new webdriver::Quick2ViewCreator ();
@@ -205,8 +198,7 @@ int main(int argc, char *argv[])
205198 #endif
206199
207200#endif
208- #endif // OS_IOS
209-
201+
210202 webdriver::ViewFactory::GetInstance ()->AddViewCreator (widgetCreator);
211203
212204 webdriver::ViewEnumerator::AddViewEnumeratorImpl (new webdriver::WidgetViewEnumeratorImpl ());
@@ -232,14 +224,18 @@ int main(int argc, char *argv[])
232224 return 0 ;
233225 }
234226
227+ #if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
235228 // check if --test_data_folder CL argument is present
236229 std::string testDataFolderSwitch = " test_data_folder" ;
230+
237231 if (cmd_line.HasSwitch (testDataFolderSwitch)) {
238- tests:: testDataFolder = cmd_line.GetSwitchValueASCII (testDataFolderSwitch);
232+ testDataFolder = cmd_line.GetSwitchValueASCII (testDataFolderSwitch);
239233 } else {
240- tests:: testDataFolder = " ./" ;
234+ testDataFolder = " ./" ;
241235 }
242- std::cout << " Using " << tests::testDataFolder << " as test data folder" << std::endl;
236+
237+ std::cout << " Using " << testDataFolder << " as test data folder" << std::endl;
238+ #endif // WD_ENABLE_PLAYER
243239
244240#if defined(OS_WIN)
245241#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
0 commit comments