mirror of
https://github.com/appium/appium.git
synced 2026-02-20 01:29:36 -06:00
prime ios screenshot command with correct orientation (fix #722)
cc @edgy360
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user