Skip to content

Commit 3153cf2

Browse files
buildbuild
authored andcommitted
Merge branch 'WD_1.X_dev' of https://portal-ua.globallogic.com/git/wd into WD_1.X_dev
2 parents 1360b79 + b955993 commit 3153cf2

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

platform/ios/wd_qt5_64.gypi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
'variables': {
33
'QT5': '1', # change to '1' for enabling Qt5
4+
'WD_BUILD_MONGOOSE': '1',
5+
'WD_CONFIG_PLAYER': '0',
46
'QT_INC_PATH': '/usr/local/opt/qt5_ios64/include',
57
'QT_LIB_PATH': '/usr/local/opt/qt5_ios64/lib',
68
'QT_BIN_PATH': '/usr/local/opt/qt5_ios64/bin',

platform/mac/wd_qt4_64.gypi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
'variables': {
3+
'QT5': '0', # change to '1' for enabling Qt5
4+
'QT_BIN_PATH': '/usr/local/opt/qt4_64/bin',
5+
'QT_INC_PATH': '/usr/local/opt/qt4_64/include',
6+
'QT_LIB_PATH': '/usr/local/opt/qt4_64/lib',
7+
},
8+
}

src/webdriver/extension_qt/qwebviewext.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
#include "webdriver_switches.h"
88
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
99
#include <QtWidgets/QWidget>
10+
#include <QtWebKitWidgets/QWebFrame>
1011
#else
1112
#include <QtGui/QWidget>
13+
#include <QtWebKit/QWebFrame>
1214
#endif
1315

1416
QWebViewExt::QWebViewExt(QWidget *parent) :
1517
QWebView(parent)
1618
{
1719
setWebInspectorProperty(this);
1820
connect(page(), SIGNAL(windowCloseRequested()), this, SLOT(close()));
21+
connect(this, SIGNAL(titleChanged(QString)), this, SLOT(setWindowTitle(QString)));
1922
}
2023

2124
QWebViewExt::~QWebViewExt()

src/webdriver/extension_qt/web_view_executor.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,6 @@ void QWebViewCmdExecutor::TouchPinchRotate(const ElementId &element, const int &
840840
float degree = angle;
841841
float rad = M_PI*degree/180;
842842

843-
844843
QTouchEvent *touchBeginEvent = create2PointTouchEvent(QEvent::TouchBegin, Qt::TouchPointPressed, startPoint, startPoint2);
845844
QApplication::postEvent(view_, touchBeginEvent);
846845

@@ -908,7 +907,7 @@ void QWebViewCmdExecutor::TouchPinchZoom(const ElementId &element, const double
908907
point2.setX(startPoint2.x() + dx*i/stepCount);
909908
else
910909
point2.setX(startPoint2.x() - dx*i/stepCount);
911-
qDebug()<<i<<point1<<point2;
910+
912911
QTouchEvent *touchMoveEvent = create2PointTouchEvent(QEvent::TouchUpdate, Qt::TouchPointMoved, point1, point2);
913912
QApplication::postEvent(view_, touchMoveEvent);
914913

web/webdriver-app.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,21 @@ VisualizerController.prototype.visualizerAssignEventHandlers = function() {
450450
});
451451

452452
hammer.on("rotate", function(event) {
453+
// get principal angle from the interval (-180, 180)
454+
function toPrincipalAngle(angle) {
455+
while (angle < 0) angle += 360;
456+
angle = angle - Math.round(angle / 360) * 360;
457+
if (angle > 180) angle -= 360;
458+
return angle;
459+
}
460+
461+
var angle = event.gesture.rotation;
462+
angle = Math.round(toPrincipalAngle(angle));
463+
453464
var xpath = Util.getXPath(event.target);
454465
var target = self.driver.findElement(webdriver.By.xpath(xpath));
455466
self.driver.actions().
456-
touchPinchRotate(target, event.gesture.rotation).
467+
touchPinchRotate(target, angle).
457468
perform();
458469
});
459470

@@ -488,6 +499,7 @@ VisualizerController.prototype.showVisualizationWindow = function(source, size)
488499
} else {
489500
var visualizerDoc = this.visualizationWin.document;
490501
visualizerDoc.write(source);
502+
visualizerDoc.title += ' - Visualizer';
491503
}
492504

493505
this.visualizerAssignEventHandlers();

0 commit comments

Comments
 (0)