prime ios screenshot command with correct orientation (fix #722)

cc @edgy360
This commit is contained in:
Jonathan Lipps
2014-06-23 16:36:09 -07:00
parent 850c486772
commit 950e9dd437

View File

@@ -1098,7 +1098,14 @@ iOSController.background = function (secs, cb) {
};
iOSController.getOrientation = function (cb) {
this.proxy("au.getScreenOrientation()", cb);
this.proxy("au.getScreenOrientation()", function (err, res) {
if (res && res.status === status.codes.Success.code) {
// keep track of orientation for our own purposes
logger.debug("Setting internal orientation to " + res.value);
this.curOrientation = res.value;
}
cb(err, res);
});
};
iOSController.setOrientation = function (orientation, cb) {
@@ -1123,6 +1130,7 @@ iOSController.getScreenshot = function (cb) {
var shotPath = [screenshotFolder, 'screenshot', guid, ".png"].join("");
async.waterfall([
function (cb) { this.getOrientation(function () { cb(); }); }.bind(this),
function (cb) { this.proxy(command, cb); }.bind(this),
function (response, cb) {
var data = null;