Skip to content

Commit 6cbf67f

Browse files
committed
Merge branch 'WD_1.X_dev' of https://portal-ua.globallogic.com/git/wd into WD_1.X_dev
2 parents 99773d9 + 35ace62 commit 6cbf67f

File tree

4 files changed

+68
-37
lines changed

4 files changed

+68
-37
lines changed

build_ios.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ if [ "$1" == "-all" ]
2727
then
2828

2929
#xcodebuild -project out/wd_test.xcodeproj -target test_ios_WD -arch i386 -sdk iphonesimulator #clean build
30-
xcodebuild -project out/base.xcodeproj -target chromium_base -arch i386 -sdk iphonesimulator clean build
31-
xcodebuild -project out/wd_core.xcodeproj -target WebDriver_core -arch i386 -sdk iphonesimulator clean build
32-
xcodebuild -project out/wd_ext_qt.xcodeproj -target WebDriver_extension_qt_base -arch i386 -sdk iphonesimulator clean build
33-
xcodebuild -project out/wd_ext_qt.xcodeproj -target WebDriver_extension_qt_quick -arch i386 -sdk iphonesimulator clean build
30+
xcodebuild -project out/base.xcodeproj -target chromium_base -arch i386 -sdk iphonesimulator6.0 clean build
31+
xcodebuild -project out/wd_core.xcodeproj -target WebDriver_core -arch i386 -sdk iphonesimulator6.0 clean build
32+
xcodebuild -project out/wd_ext_qt.xcodeproj -target WebDriver_extension_qt_base -arch i386 -sdk iphonesimulator6.0 clean build
33+
xcodebuild -project out/wd_ext_qt.xcodeproj -target WebDriver_extension_qt_quick -arch i386 -sdk iphonesimulator6.0 clean build
3434

3535

3636
cd ./platform/ios/wd

src/third_party/mongoose/mongoose.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,12 @@ 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 (!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"));
789+
790+
if (mg_strcasecmp(conn->ctx->config[ENABLE_KEEP_ALIVE], "yes") != 0)
791+
return 0;
792+
793+
return (header == NULL && http_version && !strcmp(http_version, "1.1")) ||
794+
(header != NULL && !mg_strcasecmp(header, "keep-alive"));
792795
}
793796

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

wd_build_options.gypi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@
9898

9999
} ],
100100

101+
[ 'OS == "mac"', {
102+
'xcode_settings': {
103+
'CODE_SIGN_IDENTITY': 'Developer ID Application: Mykola Tryshnivskyy (3QWMV2L87Z)',
104+
'SDKROOT': 'macosx10.8',
105+
},
106+
} ],
107+
101108
[ 'OS == "mac" or OS == "ios"', {
102109
'actions': [ {
103110
'action_name': 'create_input_dir',

web/webdriver-app.js

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ VisualizerController.prototype.visualizerAssignEventHandlers = function() {
320320
if (disableMouseEvents) {
321321
return;
322322
}
323+
if (event.button != 0) {
324+
return;
325+
}
323326

324327
var xpath = Util.getXPath(event.target);
325328
var target = self.driver.findElement(webdriver.By.xpath(xpath));
@@ -334,6 +337,9 @@ VisualizerController.prototype.visualizerAssignEventHandlers = function() {
334337
if (disableMouseEvents) {
335338
return;
336339
}
340+
if (event.button != 0) {
341+
return;
342+
}
337343

338344
var xpath = Util.getXPath(event.target);
339345
var target = self.driver.findElement(webdriver.By.xpath(xpath));
@@ -343,7 +349,7 @@ VisualizerController.prototype.visualizerAssignEventHandlers = function() {
343349
perform();
344350
};
345351

346-
win.document.onclick = function(event) {
352+
win.document.onclick = win.document.oncontextmenu = function(event) {
347353
var disableMouseEvents = document.getElementsByName('disableMouseEvents')[0].checked;
348354
if (disableMouseEvents) {
349355
return false;
@@ -352,7 +358,7 @@ VisualizerController.prototype.visualizerAssignEventHandlers = function() {
352358
if (event.target.hasAttribute('elementId')) {
353359
var elementId = event.target.getAttribute('elementId');
354360
var element = new webdriver.WebElement(self.driver, elementId);
355-
element.click();
361+
element.click(event.button);
356362
} else {
357363
var xpath = Util.getXPath(event.target);
358364
var target = self.driver.findElement(webdriver.By.xpath(xpath));
@@ -628,7 +634,7 @@ function WebDriverJsView() {
628634

629635
WebDriverJsView.prototype.getDriverUrlPort = function() {
630636
var input = document.getElementsByName('webDriverUrlPort')[0];
631-
return input.value;
637+
return input.value.trim();
632638
};
633639

634640
WebDriverJsView.prototype.setDriverUrlPort = function(value) {
@@ -639,7 +645,7 @@ WebDriverJsView.prototype.setDriverUrlPort = function(value) {
639645

640646
WebDriverJsView.prototype.getWebPage = function() {
641647
var input = document.getElementsByName('webPage')[0];
642-
return input.value;
648+
return input.value.trim();
643649
};
644650

645651
WebDriverJsView.prototype.setWebPage = function(value) {
@@ -649,8 +655,8 @@ WebDriverJsView.prototype.setWebPage = function(value) {
649655
};
650656

651657
WebDriverJsView.prototype.updateSessionDepControls = function() {
652-
var disable = this.getDriverUrlPort().trim() === '' ||
653-
this.getWebPage().trim() === '';
658+
var disable = this.getDriverUrlPort() === '' ||
659+
this.getWebPage() === '';
654660

655661
var sessionDepControls = [];
656662
sessionDepControls.push(document.getElementById('sourceButton'));
@@ -659,7 +665,7 @@ WebDriverJsView.prototype.updateSessionDepControls = function() {
659665
var control = sessionDepControls[controlIndex];
660666
control.disabled = disable;
661667
}
662-
}
668+
};
663669

664670
WebDriverJsView.prototype.setSessionId = function(id) {
665671
var element = document.getElementById('sessionIdLabel');
@@ -668,7 +674,7 @@ WebDriverJsView.prototype.setSessionId = function(id) {
668674
} else {
669675
element.innerHTML = '';
670676
}
671-
}
677+
};
672678

673679
WebDriverJsView.prototype.setFoundElementId = function(id) {
674680
var element = document.getElementById('foundElement');
@@ -681,7 +687,25 @@ WebDriverJsView.prototype.setFoundElementId = function(id) {
681687
this.setError(id.ELEMENT.message);
682688
document.getElementById('elementActions').style.visibility = 'hidden';
683689
}
684-
}
690+
};
691+
692+
WebDriverJsView.prototype.setWindowList = function(handles, activeWindowHandle) {
693+
var select = document.getElementById('windowList');
694+
select.innerHTML = '';
695+
for (var handleIndex in handles) {
696+
var handle = handles[handleIndex];
697+
var item = document.createElement('option');
698+
item.setAttribute('value', handle);
699+
item.innerHTML = handle;
700+
if (activeWindowHandle == handle) {
701+
item.innerHTML += ' (active)';
702+
item.selected = true;
703+
}
704+
select.appendChild(item)
705+
}
706+
document.getElementById('windowList').style.visibility = 'visible';
707+
document.getElementById('chooseWindow').style.visibility = 'visible';
708+
};
685709

686710
WebDriverJsView.prototype.setError = function(message) {
687711
var element = document.getElementById('error');
@@ -716,23 +740,31 @@ WebDriverJsController.prototype.setServerUrl = function(serverUrl) {
716740
}
717741

718742
WebDriverJsController.prototype.setWebPage = function(webPage) {
719-
this.element = null;
720-
721-
this.driver.get(webPage);
743+
if (webPage !== this.webPage) {
744+
this.element = null;
745+
}
722746

723747
this.webPage = webPage;
724748
if (localStorage)
725749
localStorage.webPage = webPage;
750+
this.view.setWebPage(webPage);
726751
};
727752

728753
WebDriverJsController.prototype.updateDriver = function() {
729-
var webDriverUrlPort = document.getElementsByName('webDriverUrlPort')[0].value;
754+
var self = this;
755+
var webDriverUrlPort = this.view.getDriverUrlPort();
730756
if (webDriverUrlPort !== this.webDriverUrlPort)
731757
this.setServerUrl(webDriverUrlPort);
732758

733-
var webPage = document.getElementsByName('webPage')[0].value;
734-
if (webPage !== this.webPage)
759+
var webPage = this.view.getWebPage();
760+
if (webPage === '') {
761+
this.driver.getCurrentUrl().then(function(url) {
762+
self.setWebPage(url);
763+
});
764+
} else if (webPage !== this.webPage) {
735765
this.setWebPage(webPage);
766+
this.driver.get(webPage);
767+
}
736768
};
737769

738770
WebDriverJsController.prototype.onGet = function() {
@@ -856,23 +888,9 @@ WebDriverJsController.prototype.onSendKeys = function(key) {
856888

857889
WebDriverJsController.prototype.onListWindowHandles = function() {
858890
var self = this;
859-
var select = document.getElementById('windowList');
860891
this.driver.getWindowHandle().then(function(activeWindowHandle) {
861892
self.driver.getAllWindowHandles().then(function(handles) {
862-
select.innerHTML = '';
863-
for (var handleIndex in handles) {
864-
var handle = handles[handleIndex];
865-
var item = document.createElement('option');
866-
item.setAttribute('value', handle);
867-
item.innerHTML = handle;
868-
if (activeWindowHandle == handle) {
869-
item.innerHTML += ' (active)';
870-
item.selected = true;
871-
}
872-
select.appendChild(item)
873-
}
874-
document.getElementById('windowList').style.visibility = 'visible';
875-
document.getElementById('chooseWindow').style.visibility = 'visible';
893+
self.view.setWindowList(handles, activeWindowHandle);
876894
});
877895
});
878896
};
@@ -882,6 +900,9 @@ WebDriverJsController.prototype.onChooseWindow = function() {
882900
var handle = document.getElementById('windowList').value;
883901
this.driver.switchTo().window(handle).then(function() {
884902
self.onListWindowHandles();
903+
return self.driver.getCurrentUrl();
904+
}).then(function(url) {
905+
self.setWebPage(url);
885906
});
886907
};
887908

0 commit comments

Comments
 (0)