mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Merge "Deleting screen records for succeeded tests" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1d495b2480
@@ -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