From f46de7e6908c8e118c99d9912e649f311b7b3763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Franco?= Date: Thu, 13 Jun 2024 18:43:21 +0000 Subject: [PATCH] Revert "Make sure we keep the screen record even if the test succeeds" This reverts commit ad15dd719ee50d57a9000cd6ceabfb8a63dd3773. Reason for revert: removing debug Change-Id: Id76a5b9a2e138603e896cba2a0d9b96711610f9e --- .../launcher3/ui/TaplTestsLauncher3Test.java | 4 +--- .../android/launcher3/ui/TaplWorkProfileTest.java | 2 -- .../launcher3/util/rule/ScreenRecordRule.java | 15 +-------------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java index 4a67600024..342eedf2be 100644 --- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java +++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java @@ -21,9 +21,8 @@ import static org.junit.Assert.assertNotNull; import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; -import com.android.launcher3.Launcher; -import com.android.launcher3.util.rule.ScreenRecordRule.KeepRecordOnSuccess; import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; +import com.android.launcher3.Launcher; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,7 +31,6 @@ import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) public class TaplTestsLauncher3Test extends AbstractLauncherUiTest { - @KeepRecordOnSuccess @ScreenRecord // b/322823478 @Test public void testDevicePressMenu() throws Exception { diff --git a/tests/src/com/android/launcher3/ui/TaplWorkProfileTest.java b/tests/src/com/android/launcher3/ui/TaplWorkProfileTest.java index 70a3dd001a..e08d37cb69 100644 --- a/tests/src/com/android/launcher3/ui/TaplWorkProfileTest.java +++ b/tests/src/com/android/launcher3/ui/TaplWorkProfileTest.java @@ -45,7 +45,6 @@ import com.android.launcher3.allapps.WorkPausedCard; import com.android.launcher3.allapps.WorkProfileManager; import com.android.launcher3.tapl.LauncherInstrumentation; import com.android.launcher3.util.TestUtil; -import com.android.launcher3.util.rule.ScreenRecordRule.KeepRecordOnSuccess; import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; import com.android.launcher3.util.rule.TestStabilityRule.Stability; @@ -197,7 +196,6 @@ public class TaplWorkProfileTest extends AbstractLauncherUiTest { } - @KeepRecordOnSuccess @ScreenRecord // b/322823478 @Test public void testEdu() { diff --git a/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java b/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java index ff96afb51d..7a5cf2c2cd 100644 --- a/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java +++ b/tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java @@ -49,9 +49,6 @@ public class ScreenRecordRule implements TestRule { return base; } - final Boolean keepRecordOnSuccess = description.getAnnotation(KeepRecordOnSuccess.class) - != null; - return new Statement() { @Override public void evaluate() throws Throwable { @@ -73,7 +70,7 @@ public class ScreenRecordRule implements TestRule { device.executeShellCommand("kill -INT " + screenRecordPid); Log.e(TAG, "Screenrecord captured at: " + outputFile); output.close(); - if (success && !keepRecordOnSuccess) { + if (success) { automation.executeShellCommand("rm " + outputFile); } } @@ -88,14 +85,4 @@ public class ScreenRecordRule implements TestRule { @Target(ElementType.METHOD) public @interface ScreenRecord { } - - - /** - * Interface to indicate that we should keep the screen record even if the test succeeds, use - * sparingly since it uses a lof of memory. - */ - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.METHOD) - public @interface KeepRecordOnSuccess { - } }