diff --git a/lib/devices/ios/ios.js b/lib/devices/ios/ios.js index 95172b5a9..f429f95d0 100644 --- a/lib/devices/ios/ios.js +++ b/lib/devices/ios/ios.js @@ -940,25 +940,23 @@ IOS.prototype.cleanupAppState = function (cb) { cb(err); } else { var filesExamined = 0; - var maybeNext = function () { + var doneWithFile = function () { + filesExamined++; if (filesExamined === files.length) { - if (this.args.keepKeyChains) { - // files[0] is always the Applications dir - // we want to keep it around so --keep-keychains logic will work - mkdirp.sync(files[0]); - } cb(); } }.bind(this); if (files.length) { - _.each(files, function (file) { - rimraf(file, function () { - logger.info("Deleted " + file); - filesExamined++; - maybeNext(); - }.bind(this)); + for (var i = 0; i < files.length; i++) { + if (this.args.fullReset) { + rimraf.sync(files[i]); + logger.info("Deleted " + files[i]); + if (i === 0 && this.args.keepKeyChains) { + mkdirp.sync(files[i]); + } + } - var root = path.dirname(file); + var root = path.dirname(files[i]); var tcc = path.join(root, 'Library/TCC'); if (fs.existsSync(tcc)) { rimraf.sync(tcc); @@ -982,7 +980,8 @@ IOS.prototype.cleanupAppState = function (cb) { rimraf.sync(keychain); logger.info("Deleted " + keychain); } - }.bind(this)); + doneWithFile(); + } } else { logger.info("No folders found to remove"); if (this.realDevice && this.args.bundleId) { diff --git a/test/functional/common/webview-base.js b/test/functional/common/webview-base.js index f75ec0f4a..9afc775d8 100644 --- a/test/functional/common/webview-base.js +++ b/test/functional/common/webview-base.js @@ -22,8 +22,9 @@ module.exports = function (app) { var setup = function (context) { return setupBase(context, { - nonSyntheticWebClick: false, - app: app + nonSyntheticWebClick: true, + app: app, + safariIgnoreFraudWarning: true }); }; @@ -273,6 +274,15 @@ module.exports = function (app) { driver.refresh() .nodeify(done); }); + it('should not display a phishing warning with safariIgnoreFraudWarning', function (done) { + if (isChrome) return _skip( + "Chrome doesn't test safariIgnoreFraudWarning", done); + driver + .get("http://foo:bar@google.com") + .title() + .should.eventually.contain("Google") + .nodeify(done); + }); }); describe('implicit wait', function () {