Skip to content

Commit fe3d3e4

Browse files
committed
Merge branch 'WD_1.X_dev' of https://portal-ua.globallogic.com/git/wd into WD_1.X_dev
2 parents 4810c60 + 07daeff commit fe3d3e4

File tree

9 files changed

+142
-29
lines changed

9 files changed

+142
-29
lines changed

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ else
2828
fi
2929

3030
OUT_STATIC_LIB_FILES="libchromium_base.a libWebDriver_core.a libWebDriver_extension_qt_base.a libWebDriver_extension_qt_web.a libWebDriver_extension_qt_quick.a libWebDriver_extension_qt_quick_web.a"
31-
OUT_SHARED_LIB_FILES="libchromium_base.so libWebDriver_core.so libWebDriver_extension_qt_base.so libWebDriver_extension_qt_web.so libWebDriver_extension_qt_quick.so libWebDriver_extension_qt_quick_web.so libAndroidWD.so"
31+
OUT_SHARED_LIB_FILES="libchromium_base.so libWebDriver_core.so libWebDriver_extension_qt_base.so libWebDriver_extension_qt_web.so libWebDriver_extension_qt_quick.so libWebDriver_extension_qt_quick_web.so libAndroidWD_QML.so libAndroidWD_Widgets.so"
3232
OUT_BIN_FILES="WebDriver WebDriver_noWebkit WebDriver_noWebkit_sharedLibs"
3333
GYP=`which gyp`
3434

build_android.sh

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,36 +97,60 @@ fi
9797
fi
9898

9999
dist_dir=`pwd`/out/bin/$platform/$mode
100-
export BINARY_PATH=$dist_dir/libAndroidWD.so
100+
export BINARY_PATH_WIDGETS=$dist_dir/libAndroidWD_Widgets.so
101+
export BINARY_PATH_QML=$dist_dir/libAndroidWD_QML.so
101102

102103
#clean android directory
103104
rm -rf $dist_dir/android
104105

105106

106107
echo "####################### Create apk "$arch" "$mode" #######################"
107108
mkdir -p $dist_dir/android/libs/$ANDROID_LIB_ARCH
108-
cp $BINARY_PATH $dist_dir/android/libs/$ANDROID_LIB_ARCH
109-
110-
export ANDROID_JSON_CONFIG=$dist_dir/android/android_config.json
111-
python generate_android_json.py
109+
cp $BINARY_PATH_WIDGETS $dist_dir/android/libs/$ANDROID_LIB_ARCH
112110

113111
if [ $mode = "release" ]
114112
then
115113
export RELEASE_ARG="--sign "$KEY_STORE" "$ALIAS" --storepass "$PASSWORD
116114
echo $RELEASE_ARG
117115
fi
118116

117+
export ANDROID_JSON_CONFIG=$dist_dir/android/android_config.json
118+
119+
120+
echo "####################### Widgets #######################"
121+
export BINARY_PATH=$BINARY_PATH_WIDGETS
122+
python generate_android_json.py
123+
119124
$ANDROID_DEPLOY_QT --output $dist_dir/android --input $ANDROID_JSON_CONFIG --verbose $MINISTRO $RELEASE_ARG
120125
RETVAL=$?
121126
if [ $RETVAL -ne 0 ];
122127
then
123-
echo "####################### androiddeployqt error!!! #######################"
128+
echo "####################### androiddeployqt widgets error!!! #######################"
124129
echo $RETVAL
125130
exit $RETVAL
126131
fi
127132

128-
cp $dist_dir/android/bin/QtApp-release.apk $dist_dir/AndroidWD.apk
129-
# rm -rf $dist_dir/android
133+
cp $dist_dir/android/bin/QtApp-release.apk $dist_dir/AndroidWD_Widgets.apk
134+
rm -rf $dist_dir/android
135+
136+
137+
echo "####################### QML #######################"
138+
mkdir -p $dist_dir/android/libs/$ANDROID_LIB_ARCH
139+
cp $BINARY_PATH_QML $dist_dir/android/libs/$ANDROID_LIB_ARCH
140+
export BINARY_PATH=$BINARY_PATH_QML
141+
python generate_android_json.py
142+
143+
$ANDROID_DEPLOY_QT --output $dist_dir/android --input $ANDROID_JSON_CONFIG --verbose $MINISTRO $RELEASE_ARG
144+
RETVAL=$?
145+
if [ $RETVAL -ne 0 ];
146+
then
147+
echo "####################### androiddeployqt qml error!!! #######################"
148+
echo $RETVAL
149+
exit $RETVAL
150+
fi
151+
152+
cp $dist_dir/android/bin/QtApp-release.apk $dist_dir/AndroidWD_QML.apk
153+
rm -rf $dist_dir/android
130154

131155
done
132156

platform/mac/Readme_qt4_64.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Minumum Requirements
2+
---------------------
3+
* Qt Mac OS X install:
4+
Download QT sources from
5+
http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.zip
6+
Unzip and build sources for native (64bit) architecture
7+
> configure -opensource -confirm-license -nomake examples -nomake tests -release -arch x86_64
8+
> make
9+
> make install
10+
See more details here
11+
http://qt-project.org/doc/qt-4.8/install-mac.html
12+
13+
Setup:
14+
------
15+
In command prompt run WebDriver or WebDriver_noWebkit

platform/mac/Readme_qt5_64.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Minumum Requirements
2+
---------------------
3+
* Qt Mac OS X install:
4+
Download QT sources from
5+
http://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz
6+
Untar and build sources for native (64bit) architecture
7+
> configure -opensource -confirm-license -nomake examples -nomake tests -release -arch x86_64 -no-framework
8+
> make
9+
> make install
10+
See more details here
11+
http://qt-project.org/doc/qt-5/macosx-building.html
12+
13+
Setup:
14+
------
15+
In command prompt run WebDriver or WebDriver_noWebkit

src/Test/main.cc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ int main(int argc, char *argv[])
168168
#endif // QT_VERSION
169169
#endif // WD_TEST_ENABLE_WEB_VIEW
170170

171+
#ifndef QT_NO_QML
171172
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
172173
// Quick2 extension
173174
webdriver::ViewCreator* qmlCreator = new webdriver::Quick2ViewCreator();
@@ -197,7 +198,8 @@ int main(int argc, char *argv[])
197198
//webdriver::ViewCmdExecutorFactory::GetInstance()->AddViewCmdExecutorCreator(new webdriver::QmlWebViewCmdExecutorCreator());
198199
#endif
199200

200-
#endif
201+
#endif
202+
#endif //QT_NO_QML
201203

202204
webdriver::ViewFactory::GetInstance()->AddViewCreator(widgetCreator);
203205

@@ -368,7 +370,17 @@ void PrintHelp() {
368370
<< " format: login:password@ip:port" << std::endl
369371
<< "uinput false If option set, user input device" << std::endl
370372
<< " will be registered in the system" << std::endl
371-
<< "test_data ./ Specifies where to look for test specific data" << std::endl;
373+
<< "test_data ./ Specifies where to look for test specific data" << std::endl
374+
<< "whitelist The path to whitelist file (e.g. whitelist.xml)"<< std::endl
375+
<< " in XML format with specified list of IP with" << std::endl
376+
<< " allowed/denied commands for each of them." << std::endl
377+
<< "webserver-cfg The path to mongoose config file" << std::endl
378+
<< " (e.g. /path/to/config.json) in JSON format with"<< std::endl
379+
<< " specified mongoose start option" << std::endl
380+
<< " (extra-mime-types, listening_ports, etc.)" << std::endl
381+
<< " Option from webserver config file will have" << std::endl
382+
<< " more priority than commandline param" << std::endl
383+
<< " that specify the same option." << std::endl;
372384
}
373385

374386

src/third_party/mongoose/mongoose.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,9 @@ static int match_extension(const char *path, const char *ext_list) {
786786
static int should_keep_alive(const struct mg_connection *conn) {
787787
const char *http_version = conn->request_info.http_version;
788788
const char *header = mg_get_header(conn, "Connection");
789-
return (header == NULL && http_version && !strcmp(http_version, "1.1")) ||
790-
(header != NULL && !mg_strcasecmp(header, "keep-alive"));
789+
return (!mg_strcasecmp(conn->ctx->config[ENABLE_KEEP_ALIVE], "yes") &&
790+
(header == NULL && http_version && !strcmp(http_version, "1.1"))) ||
791+
(header != NULL && !mg_strcasecmp(header, "keep-alive"));
791792
}
792793

793794
static const char *suggest_connection_header(const struct mg_connection *conn) {

src/webdriver/extension_qt/qwebkit_proxy.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@ Error* QWebkitProxy::SetActiveElement(const ElementId& element) {
477477
// the body, sometimes we still need to focus the body element for send
478478
// keys to work. Not sure why
479479
// - You cannot focus a descendant of a content editable node
480+
// - V8 throws a TypeError when calling setSelectionRange for a non-text
481+
// input, which still have setSelectionRange defined. For chrome 29+, V8
482+
// throws a DOMException with code InvalidStateError.
480483
// TODO(jleyba): Update this to use the correct atom.
481484
const char* kFocusScript =
482485
"function(elem) {"
@@ -487,10 +490,16 @@ Error* QWebkitProxy::SetActiveElement(const ElementId& element) {
487490
" elem.focus();"
488491
" if (elem != prevActiveElem && elem.value && elem.value.length &&"
489492
" elem.setSelectionRange) {"
490-
" elem.setSelectionRange(elem.value.length, elem.value.length);"
493+
" try {"
494+
" elem.setSelectionRange(elem.value.length, elem.value.length);"
495+
" } catch (error) {"
496+
" if (!(error instanceof TypeError) && !(error instanceof DOMException &&"
497+
" error.code == DOMException.INVALID_STATE_ERR))"
498+
" throw error;"
499+
" }"
491500
" }"
492501
" if (elem != doc.activeElement)"
493-
" throw new Error('Failed to send keys because cannot focus element');"
502+
" throw new Error('cannot focus element');"
494503
"}";
495504
return ExecuteScriptAndParse(GetFrame(session_->current_frame()),
496505
kFocusScript,

wd.gyp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
[ 'OS == "android"', {
7171
'dependencies': [
7272
'wd_ext_qt.gyp:WebDriver_extension_qt_base',
73-
'wd_test.gyp:test_android_WD_noWebkit',
73+
'wd_test.gyp:test_android_WD_Widgets',
74+
'wd_test.gyp:test_android_WD_QML',
7475
],
7576
} ],
7677

wd_test.gyp

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@
9191
'-lQt5Network',
9292
'-lQt5Gui',
9393
'-lQt5Core',
94-
'-lQt5Quick',
95-
'-lQt5Qml',
96-
'-lQt5Multimedia',
97-
'-lQt5MultimediaWidgets',
9894
'-lQt5AndroidExtras',
9995
'-L<(ANDROID_LIB)',
10096
'-lgnustl_shared',
@@ -170,16 +166,19 @@
170166
[ 'OS=="mac"', {
171167
'link_settings': {
172168
'libraries': [
173-
'<(QT_LIB_PATH)/libQtGui.a',
174-
'<(QT_LIB_PATH)/libQtCore.a',
175-
'<(QT_LIB_PATH)/libQtNetwork.a',
176-
'<(QT_LIB_PATH)/libQtDeclarative.a',
177-
'<(QT_LIB_PATH)/libQtXml.a',
169+
'<(QT_LIB_PATH)/QtGui.framework',
170+
'<(QT_LIB_PATH)/QtCore.framework',
171+
'<(QT_LIB_PATH)/QtNetwork.framework',
172+
'<(QT_LIB_PATH)/QtDeclarative.framework',
173+
'<(QT_LIB_PATH)/QtXml.framework',
178174
'$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
179175
'$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
180176
'$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework',
181177
'$(SDKROOT)/System/Library/Frameworks/Security.framework',
182178
],
179+
'xcode_settings': {
180+
'FRAMEWORK_SEARCH_PATHS': '<(QT_LIB_PATH)',
181+
},
183182
},
184183
} ],
185184
],
@@ -257,7 +256,7 @@
257256
'<(INTERMEDIATE_DIR)/moc_MenuTest.cc',
258257
],
259258
'conditions': [
260-
[ '<(QT5) == 1', {
259+
[ '<(QT5) == 1 and <(WD_CONFIG_PLAYER) == 1', {
261260
'sources': [
262261
'src/Test/VideoTest.h',
263262
'src/Test/VideoTest.cc',
@@ -342,7 +341,7 @@
342341
} ],
343342
[ 'OS=="mac"', {
344343
'link_settings': {
345-
'libraries': ['<(QT_LIB_PATH)/libQtWebKit.a',],
344+
'libraries': ['<(QT_LIB_PATH)/QtWebKit.framework',],
346345
},
347346
} ],
348347
],
@@ -403,10 +402,10 @@
403402
} ],
404403
],
405404
}, {
406-
'target_name': 'test_android_WD_noWebkit',
405+
'target_name': 'test_android_WD_QML',
407406
'type': 'shared_library',
408407

409-
'product_name': 'AndroidWD',
408+
'product_name': 'AndroidWD_QML',
410409

411410
'dependencies': [
412411
'base.gyp:chromium_base',
@@ -415,6 +414,43 @@
415414
'wd_ext_qt.gyp:WebDriver_extension_qt_quick',
416415
'test_widgets',
417416
],
417+
'libraries': [
418+
'-lQt5Multimedia',
419+
'-lQt5MultimediaWidgets',
420+
'-lQt5Quick',
421+
'-lQt5Qml',
422+
],
423+
424+
'sources': [
425+
'src/Test/main.cc',
426+
'src/Test/shutdown_command.cc',
427+
],
428+
429+
'conditions': [
430+
[ '<(WD_BUILD_MONGOOSE) == 0', {
431+
'sources': [
432+
'src/third_party/mongoose/mongoose.c',
433+
],
434+
} ],
435+
],
436+
437+
},
438+
{
439+
'target_name': 'test_android_WD_Widgets',
440+
'type': 'shared_library',
441+
442+
'product_name': 'AndroidWD_Widgets',
443+
444+
'dependencies': [
445+
'base.gyp:chromium_base',
446+
'wd_core.gyp:WebDriver_core',
447+
'wd_ext_qt.gyp:WebDriver_extension_qt_base',
448+
'test_widgets',
449+
],
450+
451+
'defines': [
452+
'QT_NO_QML',
453+
],
418454

419455
'sources': [
420456
'src/Test/main.cc',

0 commit comments

Comments
 (0)