commit | 7975bc977357f9784cc1565f7506362502b642a5 | [log] [tgz] |
---|---|---|
author | Vadim Tryshev <vadimt@google.com> | Mon Jul 12 20:57:36 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Jul 12 20:57:36 2021 +0000 |
tree | bc25077bd7881ec5eaf7955fb314d97d63b5ec5a | |
parent | c2db30e23a9f4cc9e01e033554a043a45bc3ac16 [diff] | |
parent | 1d495b24800dd0d10332149c5dcae7480b18498d [diff] |
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: I2ca8c5f84a216c2863eadf132bc88479665daf58
diff --git a/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java b/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java index 00b1cdd..7a5cf2c 100644 --- a/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java +++ b/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java
@@ -62,12 +62,17 @@ 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 @@ */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) - public @interface ScreenRecord { } + public @interface ScreenRecord { + } }