Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef21ccb5 authored by Vadim Tryshev's avatar Vadim Tryshev Committed by Automerger Merge Worker
Browse files

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

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

Change-Id: I9bdb02ea4e02976f78984c1b998f93b48cfa5386
parents a3b94297 1d495b24
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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 {
    }
}