Skip to content

Commit

Permalink
allow safari on ipad to launch correctly as well
Browse files Browse the repository at this point in the history
  • Loading branch information
jlipps committed Dec 19, 2013
1 parent 06e7112 commit e8a685d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/devices/ios/ios-controller.js
Expand Up @@ -1133,7 +1133,7 @@ iOSController.getWindowHandles = function(cb) {
}.bind(this));
};

iOSController.setWindow = function(name, cb) {
iOSController.setWindow = function(name, cb, skipReadyCheck) {
if (_.contains(_.pluck(this.windowHandleCache, 'id'), name)) {
var pageIdKey = parseInt(name, 10);
var next = function() {
Expand All @@ -1146,7 +1146,7 @@ iOSController.setWindow = function(name, cb) {
, value: ''
});
this.processingRemoteCmd = false;
}.bind(this));
}.bind(this), skipReadyCheck);
} else {
if (name == this.curWindowHandle){
logger.info("Remote debugger is already connected to window [" + name + "]");
Expand Down
7 changes: 5 additions & 2 deletions lib/devices/ios/safari.js
Expand Up @@ -30,8 +30,11 @@ Safari.prototype.navToInitialWebview = function(cb) {
};

Safari.prototype.navToLatestAvailableWebview = function(cb) {
var isiPhone = this.getDeviceString().toLowerCase().indexOf("ipad") === -1;
logger.info("Navigating to most recently opened webview");
this.complexTap(1, 1, 0.4, 0.14, 0.23, null, function() {
var x = isiPhone ? 0.14 : 0.24;
var y = isiPhone ? 0.23 : 0.13;
this.complexTap(1, 1, 0.4, x, y, null, function() {
var start = Date.now();
var spinHandles = function() {
this.getWindowHandles(function(err, res) {
Expand All @@ -49,7 +52,7 @@ Safari.prototype.navToLatestAvailableWebview = function(cb) {
if (err) return cb(err);
this.remote.cancelPageLoad();
cb();
}.bind(this));
}.bind(this), true);
}
}.bind(this));
}.bind(this);
Expand Down

0 comments on commit e8a685d

Please sign in to comment.