From 261708ba0014844b22048da88db91255f3748b29 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 23 Jul 2021 15:38:16 +0100 Subject: [PATCH] Clean up debug flags and add more screen record Bug: 193440212 Bug: 194484556 Test: manual Change-Id: I1b09ae74462c86afb8effb0a2635fd0e70a59bf8 --- .../com/android/quickstep/DigitalWellBeingToastTest.java | 2 ++ .../src/com/android/quickstep/FallbackRecentsTest.java | 2 ++ .../tests/src/com/android/quickstep/TaplTestsQuickstep.java | 6 +----- src/com/android/launcher3/touch/BaseSwipeDetector.java | 5 +---- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java b/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java index 3e84a76695..fef9304a7e 100644 --- a/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java +++ b/quickstep/tests/src/com/android/quickstep/DigitalWellBeingToastTest.java @@ -16,6 +16,7 @@ import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import com.android.launcher3.Launcher; +import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; import com.android.quickstep.views.DigitalWellBeingToast; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; @@ -32,6 +33,7 @@ public class DigitalWellBeingToastTest extends AbstractQuickStepTest { resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR); @Test + @ScreenRecord //b/193440212 public void testToast() throws Exception { startAppFast(CALCULATOR_PACKAGE); diff --git a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java index a683d01f6c..20b4715367 100644 --- a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java +++ b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java @@ -59,6 +59,7 @@ import com.android.launcher3.testcomponent.TestCommandReceiver; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.util.Wait; import com.android.launcher3.util.rule.FailureWatcher; +import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; import com.android.quickstep.views.RecentsView; import org.junit.After; @@ -213,6 +214,7 @@ public class FallbackRecentsTest { // b/143488140 //@NavigationModeSwitch @Test + @ScreenRecord // b/194484556 public void testOverview() { startAppFast(getAppPackageName()); startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index c14a5904f3..ea69b945d3 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -93,7 +93,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @PortraitLandscape - @ScreenRecord //b/191344757 + @ScreenRecord //b/193440212 public void testOverview() throws Exception { startTestAppsWithCheck(); // mLauncher.pressHome() also tests an important case of pressing home while in background. @@ -159,7 +159,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @NavigationModeSwitch @PortraitLandscape - @ScreenRecord //b/191344757 public void testOverviewActions() throws Exception { // Experimenting for b/165029151: final Overview overview = mLauncher.pressHome().switchToOverview(); @@ -185,7 +184,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @NavigationModeSwitch @PortraitLandscape - @ScreenRecord //b/191344757 public void testSwitchToOverview() throws Exception { assertNotNull("Workspace.switchToOverview() returned null", mLauncher.pressHome().switchToOverview()); @@ -196,7 +194,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @NavigationModeSwitch @PortraitLandscape - @ScreenRecord //b/191344757 public void testBackground() throws Exception { startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR)); final Background background = getAndAssertBackground(); @@ -218,7 +215,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @PortraitLandscape - @ScreenRecord //b/191344757 public void testAllAppsFromHome() throws Exception { // Test opening all apps assertNotNull("switchToAllApps() returned null", diff --git a/src/com/android/launcher3/touch/BaseSwipeDetector.java b/src/com/android/launcher3/touch/BaseSwipeDetector.java index cfd3153632..1276ece7e2 100644 --- a/src/com/android/launcher3/touch/BaseSwipeDetector.java +++ b/src/com/android/launcher3/touch/BaseSwipeDetector.java @@ -17,8 +17,6 @@ package com.android.launcher3.touch; import static android.view.MotionEvent.INVALID_POINTER_ID; -import static com.android.launcher3.Utilities.IS_RUNNING_IN_TEST_HARNESS; - import android.graphics.PointF; import android.util.Log; import android.view.MotionEvent; @@ -43,8 +41,7 @@ import java.util.Queue; */ public abstract class BaseSwipeDetector { - // b/193440212: Debug swipe gesture in tests. - private static final boolean DBG = IS_RUNNING_IN_TEST_HARNESS; + private static final boolean DBG = false; private static final String TAG = "BaseSwipeDetector"; private static final float ANIMATION_DURATION = 1200; /** The minimum release velocity in pixels per millisecond that triggers fling.*/