Moved getCurrentActivity to android-common.js

This commit is contained in:
Chi Thu Le
2013-11-08 20:39:37 +01:00
parent 86060e7c5f
commit f8e2909ed2
3 changed files with 14 additions and 30 deletions

View File

@@ -283,5 +283,19 @@ androidCommon.getLogTypes = function(cb) {
});
};
androidCommon.getCurrentActivity = function(cb) {
this.adb.getFocusedPackageAndActivity(function(err, curPackage, activity) {
if (err) {
return cb(null, {
status: status.codes.UnknownError.code
, value: err.message
});
}
cb(null, {
status: status.codes.Success.code
, value: activity
});
});
};
module.exports = androidCommon;

View File

@@ -608,21 +608,6 @@ androidController.deleteCookies = function(cb) {
cb(new NotYetImplementedError(), null);
};
androidController.getCurrentActivity = function(cb) {
this.adb.getFocusedPackageAndActivity(function(err, curPackage, activity) {
if (err) {
return cb(null, {
status: status.codes.UnknownError.code
, value: err.message
});
}
cb(null, {
status: status.codes.Success.code
, value: activity
});
});
};
androidController.fastReset = function(cb) {
async.series([
function(cb) { this.adb.stopAndClear(this.appPackage, cb); }.bind(this),

View File

@@ -270,21 +270,6 @@ Selendroid.prototype.insertSelendroidManifest = function(serverPath, cb) {
], cb);
};
Selendroid.prototype.getCurrentActivity = function(cb) {
this.adb.getFocusedPackageAndActivity(function(err, curPackage, activity) {
if (err) {
return cb(null, {
status: status.codes.UnknownError.code
, value: err.message
});
}
cb(null, {
status: status.codes.Success.code
, value: activity
});
});
};
Selendroid.prototype = _.extend(Selendroid.prototype, androidCommon);
module.exports = function(opts) {