Fix screenshotStatus

This commit is contained in:
bootstraponline
2013-09-12 08:46:23 -04:00
parent 868a3202bf
commit bb7affb9eb
2 changed files with 10 additions and 4 deletions
@@ -26,8 +26,9 @@ public class TakeScreenshot extends CommandHandler {
*/
@Override
public AndroidCommandResult execute(final AndroidCommand command) {
final boolean result = UiDevice.getInstance().takeScreenshot(
new File("/data/local/tmp/screenshot.png"));
final File screenshot = new File("/data/local/tmp/screenshot.png");
screenshot.mkdirs();
final boolean result = UiDevice.getInstance().takeScreenshot(screenshot);
return getSuccessResult(result);
}
}
+7 -2
View File
@@ -747,9 +747,14 @@ Android.prototype.getScreenshot = function(cb) {
}
],
// Top level cb
function(){
function(err, res) {
var screenshotStatus = status.codes.Success.code;
try {
screenshotStatus = res[0].value === false ? status.codes.UnknownError.code : screenshotStatus;
} catch(e) {
}
cb(null, {
status: status.codes.Success.code
status: screenshotStatus
, value: b64data
});
});