commit | 425f36e58dfc09cc0786e40308dca5c4bbba1d6d | [log] [tgz] |
---|---|---|
author | Vadim Tryshev <vadimt@google.com> | Mon Jul 12 21:11:29 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Jul 12 21:11:29 2021 +0000 |
tree | a45caf6ca9764a6a7303f472fa95e93a41fe6913 | |
parent | 31aa57a82e4d5c00f21e7dd50612920a70c43615 [diff] | |
parent | ef21ccb501190515e30d044b4b259afd7473b37f [diff] |
Merge "Deleting screen records for succeeded tests" into sc-dev am: 1d495b2480 am: ef21ccb501 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15193183 Change-Id: Ia74a83fb98858cd49969d09a269e3cdce3620da6
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 { + } }