commit | 3bb05dd3dcd48d264a36d5053fe7f16cf3467c9d | [log] [tgz] |
---|---|---|
author | Vadim Tryshev <vadimt@google.com> | Mon Jul 12 20:57:40 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Jul 12 20:57:40 2021 +0000 |
tree | 82df091770008fb323071e54fede4b376102ad74 | |
parent | 1663b2fd1c47123db8ea01d766f5064e95f45eb1 [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: I8a1cd3a27060b92a00cac7633598b431ed7332a3
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 { + } }