commit | ef21ccb501190515e30d044b4b259afd7473b37f | [log] [tgz] |
---|---|---|
author | Vadim Tryshev <vadimt@google.com> | Mon Jul 12 20:58:36 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Jul 12 20:58:36 2021 +0000 |
tree | 82321bb7f41a2800a5620bf59cb1966da3541533 | |
parent | a3b942972f510597d4aaac8020a6ad7811903e4f [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: I9bdb02ea4e02976f78984c1b998f93b48cfa5386
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 { + } }