Merge pull request #2106 from jlipps/master

reset fixes
This commit is contained in:
bootstraponline
2014-03-20 08:05:04 -04:00
+2 -9
View File
@@ -24,6 +24,7 @@ var DT_IOS = "ios"
var Appium = function (args) {
this.args = args;
this.args.fastReset = !this.args.fullReset && !this.args.noReset;
this.serverArgs = _.clone(args);
this.rest = null;
this.webSocket = null;
@@ -34,8 +35,6 @@ var Appium = function (args) {
this.oldDesiredCapabilities = {};
this.session = null;
this.preLaunched = false;
this.fastReset = !this.args.fullReset && !this.args.noReset;
this.args.fastReset = this.fastReset;
this.sessionOverride = this.args.sessionOverride;
this.resetting = false;
this.defCommandTimeoutMs = this.args.defaultCommandTimeout * 1000;
@@ -372,10 +371,7 @@ Appium.prototype.reset = function (cb) {
this.device.fastReset(function (err) {
jwpResponse(err, cb);
});
} else if (!this.args.fastReset &&
typeof this.device.fullReset === "function") {
logger.info("Running full reset on device");
} else if (!this.args.fastReset) {
} else {
logger.info("Running generic full reset");
var oldImpWait = this.device.implicitWaitMs
, oldCommandTimeoutMs = this.commandTimeoutMs
@@ -392,9 +388,6 @@ Appium.prototype.reset = function (cb) {
this.setCommandTimeout(oldCommandTimeoutMs / 1000, cb);
}.bind(this));
}.bind(this));
} else {
logger.warn("No reset strategy available");
jwpResponse(cb);
}
};