mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
Deleting screen records for succeeded tests
Test: local runs Bug: 187761685 Change-Id: I3b1a75b775d1d6677b331869a063fc6132217947
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user