Skip to content

Commit ae6dd28

Browse files
author
Mykola
committed
Add WD_CONFIG_PLAYER option
1 parent e8b2fb9 commit ae6dd28

File tree

4 files changed

+29
-28
lines changed

4 files changed

+29
-28
lines changed

src/Test/main.cc

+4-8
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,9 @@ std::string tests::testDataFolder;
4343
#endif
4444

4545
// Commented VideoTest due to error https://bugreports.qt-project.org/browse/QTBUG-32949
46-
#ifndef OS_IOS
47-
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
46+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
4847
#include "VideoTest.h"
49-
#endif
50-
#endif//OS_IOS
48+
#endif//WD_ENABLE_PLAYER
5149

5250
#include "base/at_exit.h"
5351
#include "webdriver_server.h"
@@ -149,11 +147,9 @@ int main(int argc, char *argv[])
149147
widgetCreator->RegisterViewClass<WindowWithDeclarativeViewTestWidget>("WindowWithDeclarativeViewTestWidget");
150148
#endif
151149

152-
#ifndef OS_IOS
153-
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
150+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
154151
widgetCreator->RegisterViewClass<VideoTestWidget>("VideoTestWidget");
155-
#endif
156-
#endif //OS_IOS
152+
#endif //WD_ENABLE_PLAYER
157153

158154
#if (WD_TEST_ENABLE_WEB_VIEW == 1)
159155
webdriver::ViewCreator* webCreator = new webdriver::QWebViewCreator();

src/webdriver/extension_qt/widget_view_executor.cc

+13-13
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
#include <QtWidgets/QProgressBar>
3535
#include <QtWidgets/QListView>
3636
#include <QtWidgets/QAction>
37-
#ifndef OS_IOS
37+
#if (1 == WD_ENABLE_PLAYER)
3838
#include <QtMultimediaWidgets/QVideoWidget>
3939
#include <QtMultimedia/QMediaPlayer>
40-
#endif //OS_IOS
40+
#endif //WD_ENABLE_PLAYER
4141
#else
4242
#include <QtGui/QApplication>
4343
#include <QtGui/QLineEdit>
@@ -1171,7 +1171,7 @@ void QWidgetViewCmdExecutor::TouchFlick(const ElementId &element, const int &xof
11711171

11721172
void QWidgetViewCmdExecutor::GetPlayerState(const ElementId &element, PlayerState *state, Error **error)
11731173
{
1174-
#if (!OS_IOS) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1174+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
11751175
QWidget* view = getView(view_id_, error);
11761176
if (NULL == view)
11771177
return;
@@ -1199,7 +1199,7 @@ void QWidgetViewCmdExecutor::GetPlayerState(const ElementId &element, PlayerStat
11991199

12001200
void QWidgetViewCmdExecutor::SetPlayerState(const ElementId &element, PlayerState state, Error **error)
12011201
{
1202-
#if (!OS_IOS) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1202+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
12031203
QWidget* view = getView(view_id_, error);
12041204
if (NULL == view)
12051205
return;
@@ -1233,7 +1233,7 @@ void QWidgetViewCmdExecutor::SetPlayerState(const ElementId &element, PlayerStat
12331233

12341234
void QWidgetViewCmdExecutor::GetPlayerVolume(const ElementId &element, double *volume, Error **error)
12351235
{
1236-
#if (!OS_IOS) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1236+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
12371237
QWidget* view = getView(view_id_, error);
12381238
if (NULL == view)
12391239
return;
@@ -1262,7 +1262,7 @@ void QWidgetViewCmdExecutor::GetPlayerVolume(const ElementId &element, double *v
12621262

12631263
void QWidgetViewCmdExecutor::SetPlayerVolume(const ElementId &element, double volume, Error **error)
12641264
{
1265-
#if (!OS_IOS) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1265+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
12661266
QWidget* view = getView(view_id_, error);
12671267
if (NULL == view)
12681268
return;
@@ -1291,7 +1291,7 @@ void QWidgetViewCmdExecutor::SetPlayerVolume(const ElementId &element, double vo
12911291

12921292
void QWidgetViewCmdExecutor::GetPlayingPosition(const ElementId &element, double *position, Error **error)
12931293
{
1294-
#if (!OS_IOS) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1294+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
12951295
QWidget* view = getView(view_id_, error);
12961296
if (NULL == view)
12971297
return;
@@ -1319,7 +1319,7 @@ void QWidgetViewCmdExecutor::GetPlayingPosition(const ElementId &element, double
13191319

13201320
void QWidgetViewCmdExecutor::SetPlayingPosition(const ElementId &element, double position, Error **error)
13211321
{
1322-
#if (!OS_IOS) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1322+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
13231323
QWidget* view = getView(view_id_, error);
13241324
if (NULL == view)
13251325
return;
@@ -1347,7 +1347,7 @@ void QWidgetViewCmdExecutor::SetPlayingPosition(const ElementId &element, double
13471347

13481348
void QWidgetViewCmdExecutor::SetMute(const ElementId &element, bool mute, Error **error)
13491349
{
1350-
#if (!OS_IOS) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1350+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
13511351
QWidget* view = getView(view_id_, error);
13521352
if (NULL == view)
13531353
return;
@@ -1375,7 +1375,7 @@ void QWidgetViewCmdExecutor::SetMute(const ElementId &element, bool mute, Error
13751375

13761376
void QWidgetViewCmdExecutor::GetMute(const ElementId &element, bool *mute, Error **error)
13771377
{
1378-
#if (!OS_IOS) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1378+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
13791379
QWidget* view = getView(view_id_, error);
13801380
if (NULL == view)
13811381
return;
@@ -1403,7 +1403,7 @@ void QWidgetViewCmdExecutor::GetMute(const ElementId &element, bool *mute, Error
14031403

14041404
void QWidgetViewCmdExecutor::SetPlaybackSpeed(const ElementId &element, double speed, Error **error)
14051405
{
1406-
#if (!OS_IOS) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1406+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
14071407
QWidget* view = getView(view_id_, error);
14081408
if (NULL == view)
14091409
return;
@@ -1431,7 +1431,7 @@ void QWidgetViewCmdExecutor::SetPlaybackSpeed(const ElementId &element, double s
14311431

14321432
void QWidgetViewCmdExecutor::GetPlaybackSpeed(const ElementId &element, double *speed, Error **error)
14331433
{
1434-
#if (!OS_IOS) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
1434+
#if (1 == WD_ENABLE_PLAYER) && (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
14351435
QWidget* view = getView(view_id_, error);
14361436
if (NULL == view)
14371437
return;
@@ -1454,7 +1454,7 @@ void QWidgetViewCmdExecutor::GetPlaybackSpeed(const ElementId &element, double *
14541454
*speed = player->playbackRate();
14551455
#else
14561456
NOT_SUPPORTED_IMPL
1457-
#endif
1457+
#endif
14581458
}
14591459

14601460
bool QWidgetViewCmdExecutor::MatchNativeElement(const QObject* item, const std::string& locator, const std::string& query) {

wd_build_options.gypi

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
# do not require cygwin
33
'msvs_cygwin_shell': 0,
44

@@ -50,7 +50,7 @@
5050
'action_name': 'input_dir',
5151
'inputs': [],
5252
'outputs': ['<(INTERMEDIATE_DIR)'],
53-
'action': ['mkdir', '-p', '<(INTERMEDIATE_DIR)'],
53+
'action': ['mkdir', '-p', '<(INTERMEDIATE_DIR)'],
5454
} ],
5555
'defines': [
5656
'__STDC_FORMAT_MACROS',
@@ -63,7 +63,7 @@
6363
'action_name': 'input_dir',
6464
'inputs': [],
6565
'outputs': ['<(INTERMEDIATE_DIR)'],
66-
'action': ['mkdir', '-p', '<(INTERMEDIATE_DIR)'],
66+
'action': ['mkdir', '-p', '<(INTERMEDIATE_DIR)'],
6767
} ],
6868
'defines': [
6969
'ANDROID',
@@ -88,7 +88,7 @@
8888
'NOMINMAX',
8989
'_UNICODE',
9090
'_WINSOCKAPI_',
91-
],
91+
],
9292

9393
'msvs_settings': {
9494
'VCCLCompilerTool': {
@@ -99,11 +99,11 @@
9999
} ],
100100

101101
[ 'OS == "mac" or OS == "ios"', {
102-
'actions': [ {
102+
'actions': [ {
103103
'action_name': 'create_input_dir',
104104
'inputs': [],
105105
'outputs': [],
106-
'action': ['mkdir', '-p', '<(INTERMEDIATE_DIR)'],
106+
'action': ['mkdir', '-p', '<(INTERMEDIATE_DIR)'],
107107
} ],
108108

109109
'defines': [
@@ -120,6 +120,10 @@
120120
'SDKROOT': 'iphonesimulator',
121121
'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
122122
},
123-
}],
123+
}],
124+
125+
[ '<(WD_CONFIG_PLAYER) == 1', {
126+
'defines': [ 'WD_ENABLE_PLAYER=1' ],
127+
} ]
124128
],
125129
}

wd_common.gypi

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
'WD_CONFIG_WEBKIT%': '1',
66
'WD_CONFIG_QUICK%': '1',
77
'WD_BUILD_MONGOOSE%': '0',
8+
'WD_CONFIG_PLAYER%': '1',
89

910
'QT_BIN_PATH%': '/usr/lib/qt4/bin',
1011
'QT_INC_PATH%': '/usr/include',

0 commit comments

Comments
 (0)