Loading ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java +9 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.launcher3.testing; import static com.android.launcher3.testing.shared.TestProtocol.VIEW_AND_ACTIVITY_LEAKS; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MODEL_EXECUTOR; Loading @@ -24,7 +25,9 @@ import android.app.Application; import android.content.Context; import android.os.Binder; import android.os.Bundle; import android.os.Process; import android.system.Os; import android.util.Log; import android.view.View; import androidx.annotation.Keep; Loading Loading @@ -157,11 +160,17 @@ public class DebugTestInformationHandler extends TestInformationHandler { case TestProtocol.REQUEST_VIEW_LEAK: { if (sLeaks == null) sLeaks = new LinkedList(); Log.d(VIEW_AND_ACTIVITY_LEAKS, "forcefully leaking 2 views"); sLeaks.add(new View(mContext)); sLeaks.add(new View(mContext)); return response; } case TestProtocol.PRINT_VIEW_LEAK: { Log.d(VIEW_AND_ACTIVITY_LEAKS, "(pid=" + Process.myPid() + ") sLeaks=" + sLeaks); return response; } case TestProtocol.REQUEST_START_EVENT_LOGGING: { sEvents = new ArrayList<>(); TestLogging.setEventConsumer( Loading tests/shared/com/android/launcher3/testing/shared/TestProtocol.java +1 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ public final class TestProtocol { public static final String REQUEST_PID = "pid"; public static final String REQUEST_FORCE_GC = "gc"; public static final String REQUEST_VIEW_LEAK = "view-leak"; public static final String PRINT_VIEW_LEAK = "print-leak"; public static final String REQUEST_RECENT_TASKS_LIST = "recent-tasks-list"; public static final String REQUEST_START_EVENT_LOGGING = "start-event-logging"; public static final String REQUEST_GET_TEST_EVENTS = "get-test-events"; Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +4 −0 Original line number Diff line number Diff line Loading @@ -1830,6 +1830,10 @@ public final class LauncherInstrumentation { getTestInfo(TestProtocol.REQUEST_VIEW_LEAK); } public void printViewLeak() { getTestInfo(TestProtocol.PRINT_VIEW_LEAK); } public ArrayList<ComponentName> getRecentTasks() { ArrayList<ComponentName> tasks = new ArrayList<>(); ArrayList<String> components = getTestInfo(TestProtocol.REQUEST_RECENT_TASKS_LIST) Loading Loading
ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java +9 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.launcher3.testing; import static com.android.launcher3.testing.shared.TestProtocol.VIEW_AND_ACTIVITY_LEAKS; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MODEL_EXECUTOR; Loading @@ -24,7 +25,9 @@ import android.app.Application; import android.content.Context; import android.os.Binder; import android.os.Bundle; import android.os.Process; import android.system.Os; import android.util.Log; import android.view.View; import androidx.annotation.Keep; Loading Loading @@ -157,11 +160,17 @@ public class DebugTestInformationHandler extends TestInformationHandler { case TestProtocol.REQUEST_VIEW_LEAK: { if (sLeaks == null) sLeaks = new LinkedList(); Log.d(VIEW_AND_ACTIVITY_LEAKS, "forcefully leaking 2 views"); sLeaks.add(new View(mContext)); sLeaks.add(new View(mContext)); return response; } case TestProtocol.PRINT_VIEW_LEAK: { Log.d(VIEW_AND_ACTIVITY_LEAKS, "(pid=" + Process.myPid() + ") sLeaks=" + sLeaks); return response; } case TestProtocol.REQUEST_START_EVENT_LOGGING: { sEvents = new ArrayList<>(); TestLogging.setEventConsumer( Loading
tests/shared/com/android/launcher3/testing/shared/TestProtocol.java +1 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ public final class TestProtocol { public static final String REQUEST_PID = "pid"; public static final String REQUEST_FORCE_GC = "gc"; public static final String REQUEST_VIEW_LEAK = "view-leak"; public static final String PRINT_VIEW_LEAK = "print-leak"; public static final String REQUEST_RECENT_TASKS_LIST = "recent-tasks-list"; public static final String REQUEST_START_EVENT_LOGGING = "start-event-logging"; public static final String REQUEST_GET_TEST_EVENTS = "get-test-events"; Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +4 −0 Original line number Diff line number Diff line Loading @@ -1830,6 +1830,10 @@ public final class LauncherInstrumentation { getTestInfo(TestProtocol.REQUEST_VIEW_LEAK); } public void printViewLeak() { getTestInfo(TestProtocol.PRINT_VIEW_LEAK); } public ArrayList<ComponentName> getRecentTasks() { ArrayList<ComponentName> tasks = new ArrayList<>(); ArrayList<String> components = getTestInfo(TestProtocol.REQUEST_RECENT_TASKS_LIST) Loading