Loading src/com/android/launcher3/testing/TestInformationHandler.java +6 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.graphics.Bitmap; import android.graphics.Color; import android.os.Bundle; import android.os.Debug; import android.system.Os; import android.view.View; import androidx.annotation.Keep; Loading Loading @@ -136,6 +137,11 @@ public class TestInformationHandler implements ResourceBasedOverride { break; } case TestProtocol.REQUEST_PID: { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, Os.getpid()); break; } case TestProtocol.REQUEST_TOTAL_PSS_KB: { runGcAndFinalizersSync(); Debug.MemoryInfo mem = new Debug.MemoryInfo(); Loading src/com/android/launcher3/testing/TestProtocol.java +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ public final class TestProtocol { public static final String REQUEST_APPS_LIST_SCROLL_Y = "apps-list-scroll-y"; public static final String REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN = "overview-left-margin"; public static final String REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN = "overview-right-margin"; public static final String REQUEST_PID = "pid"; public static final String REQUEST_TOTAL_PSS_KB = "total_pss"; public static final String REQUEST_JAVA_LEAK = "java-leak"; public static final String REQUEST_NATIVE_LEAK = "native-leak"; Loading src/com/android/launcher3/views/OptionsPopupView.java +0 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ import com.android.launcher3.widget.WidgetsFullSheet; import java.util.ArrayList; import java.util.List; /** * Popup shown on long pressing an empty space in launcher */ Loading tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +23 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,9 @@ package com.android.launcher3.ui; import static androidx.test.InstrumentationRegistry.getInstrumentation; import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL; import static com.android.launcher3.util.rule.TestStabilityRule.UNBUNDLED_POSTSUBMIT; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; Loading @@ -36,10 +39,12 @@ import com.android.launcher3.tapl.AppIconMenu; import com.android.launcher3.tapl.AppIconMenuItem; import com.android.launcher3.tapl.Widgets; import com.android.launcher3.tapl.Workspace; import com.android.launcher3.util.rule.TestStabilityRule.Stability; import com.android.launcher3.views.OptionsPopupView; import com.android.launcher3.widget.WidgetsFullSheet; import com.android.launcher3.widget.WidgetsRecyclerView; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; Loading @@ -50,10 +55,18 @@ import org.junit.runner.RunWith; public class TaplTestsLauncher3 extends AbstractLauncherUiTest { private static final String APP_NAME = "LauncherTestApp"; private int mLauncherPid; @Before public void setUp() throws Exception { super.setUp(); initialize(this); mLauncherPid = mLauncher.getPid(); } @After public void teardown() { assertEquals("Launcher crashed, pid mismatch:", mLauncherPid, mLauncher.getPid()); } public static void initialize(AbstractLauncherUiTest test) throws Exception { Loading Loading @@ -100,6 +113,16 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { mLauncher.pressHome(); } // b/146432215: remove @Stability after 2/1/2020 if this test doesn't flake @Test @Stability(flavors = LOCAL | UNBUNDLED_POSTSUBMIT) public void testOpenHomeSettingsFromWorkspace() { mDevice.pressMenu(); mDevice.waitForIdle(); mLauncher.getOptionsPopupMenu().getMenuItem("Home settings") .launch(mDevice.getLauncherPackageName()); } @Test @Ignore public void testPressHomeOnAllAppsContextMenu() throws Exception { Loading tests/tapl/com/android/launcher3/tapl/AppIcon.java +2 −11 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package com.android.launcher3.tapl; import android.graphics.Point; import android.os.SystemClock; import android.view.MotionEvent; import android.widget.TextView; import androidx.test.uiautomator.By; Loading @@ -41,14 +38,8 @@ public final class AppIcon extends Launchable { * Long-clicks the icon to open its menu. */ public AppIconMenu openMenu() { final Point iconCenter = mObject.getVisibleCenter(); final long downTime = SystemClock.uptimeMillis(); mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, iconCenter); final UiObject2 deepShortcutsContainer = mLauncher.waitForLauncherObject( "deep_shortcuts_container"); mLauncher.sendPointer( downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, iconCenter); return new AppIconMenu(mLauncher, deepShortcutsContainer); return new AppIconMenu(mLauncher, mLauncher.clickAndGet( mObject, "deep_shortcuts_container")); } @Override Loading Loading
src/com/android/launcher3/testing/TestInformationHandler.java +6 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.graphics.Bitmap; import android.graphics.Color; import android.os.Bundle; import android.os.Debug; import android.system.Os; import android.view.View; import androidx.annotation.Keep; Loading Loading @@ -136,6 +137,11 @@ public class TestInformationHandler implements ResourceBasedOverride { break; } case TestProtocol.REQUEST_PID: { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, Os.getpid()); break; } case TestProtocol.REQUEST_TOTAL_PSS_KB: { runGcAndFinalizersSync(); Debug.MemoryInfo mem = new Debug.MemoryInfo(); Loading
src/com/android/launcher3/testing/TestProtocol.java +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ public final class TestProtocol { public static final String REQUEST_APPS_LIST_SCROLL_Y = "apps-list-scroll-y"; public static final String REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN = "overview-left-margin"; public static final String REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN = "overview-right-margin"; public static final String REQUEST_PID = "pid"; public static final String REQUEST_TOTAL_PSS_KB = "total_pss"; public static final String REQUEST_JAVA_LEAK = "java-leak"; public static final String REQUEST_NATIVE_LEAK = "native-leak"; Loading
src/com/android/launcher3/views/OptionsPopupView.java +0 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ import com.android.launcher3.widget.WidgetsFullSheet; import java.util.ArrayList; import java.util.List; /** * Popup shown on long pressing an empty space in launcher */ Loading
tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java +23 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,9 @@ package com.android.launcher3.ui; import static androidx.test.InstrumentationRegistry.getInstrumentation; import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL; import static com.android.launcher3.util.rule.TestStabilityRule.UNBUNDLED_POSTSUBMIT; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; Loading @@ -36,10 +39,12 @@ import com.android.launcher3.tapl.AppIconMenu; import com.android.launcher3.tapl.AppIconMenuItem; import com.android.launcher3.tapl.Widgets; import com.android.launcher3.tapl.Workspace; import com.android.launcher3.util.rule.TestStabilityRule.Stability; import com.android.launcher3.views.OptionsPopupView; import com.android.launcher3.widget.WidgetsFullSheet; import com.android.launcher3.widget.WidgetsRecyclerView; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; Loading @@ -50,10 +55,18 @@ import org.junit.runner.RunWith; public class TaplTestsLauncher3 extends AbstractLauncherUiTest { private static final String APP_NAME = "LauncherTestApp"; private int mLauncherPid; @Before public void setUp() throws Exception { super.setUp(); initialize(this); mLauncherPid = mLauncher.getPid(); } @After public void teardown() { assertEquals("Launcher crashed, pid mismatch:", mLauncherPid, mLauncher.getPid()); } public static void initialize(AbstractLauncherUiTest test) throws Exception { Loading Loading @@ -100,6 +113,16 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest { mLauncher.pressHome(); } // b/146432215: remove @Stability after 2/1/2020 if this test doesn't flake @Test @Stability(flavors = LOCAL | UNBUNDLED_POSTSUBMIT) public void testOpenHomeSettingsFromWorkspace() { mDevice.pressMenu(); mDevice.waitForIdle(); mLauncher.getOptionsPopupMenu().getMenuItem("Home settings") .launch(mDevice.getLauncherPackageName()); } @Test @Ignore public void testPressHomeOnAllAppsContextMenu() throws Exception { Loading
tests/tapl/com/android/launcher3/tapl/AppIcon.java +2 −11 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package com.android.launcher3.tapl; import android.graphics.Point; import android.os.SystemClock; import android.view.MotionEvent; import android.widget.TextView; import androidx.test.uiautomator.By; Loading @@ -41,14 +38,8 @@ public final class AppIcon extends Launchable { * Long-clicks the icon to open its menu. */ public AppIconMenu openMenu() { final Point iconCenter = mObject.getVisibleCenter(); final long downTime = SystemClock.uptimeMillis(); mLauncher.sendPointer(downTime, downTime, MotionEvent.ACTION_DOWN, iconCenter); final UiObject2 deepShortcutsContainer = mLauncher.waitForLauncherObject( "deep_shortcuts_container"); mLauncher.sendPointer( downTime, SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, iconCenter); return new AppIconMenu(mLauncher, deepShortcutsContainer); return new AppIconMenu(mLauncher, mLauncher.clickAndGet( mObject, "deep_shortcuts_container")); } @Override Loading