Merge "Deleting screen records for succeeded tests" into sc-dev am: 1d495b2480

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15193183

Change-Id: I8a1cd3a27060b92a00cac7633598b431ed7332a3
This commit is contained in:
Vadim Tryshev
2021-07-12 20:57:40 +00:00
committed by Automerger Merge Worker
@@ -62,12 +62,17 @@ public class ScreenRecordRule implements TestRule {
ParcelFileDescriptor output =
automation.executeShellCommand("screenrecord " + outputFile);
String screenRecordPid = device.executeShellCommand("pidof screenrecord");
boolean success = false;
try {
base.evaluate();
success = true;
} finally {
device.executeShellCommand("kill -INT " + screenRecordPid);
Log.e(TAG, "Screenrecord captured at: " + outputFile);
output.close();
if (success) {
automation.executeShellCommand("rm " + outputFile);
}
}
}
};
@@ -78,5 +83,6 @@ public class ScreenRecordRule implements TestRule {
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ScreenRecord { }
public @interface ScreenRecord {
}
}