Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +13 −3 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.view.MotionEvent; import android.view.Surface; import android.view.ViewConfiguration; import android.view.accessibility.AccessibilityEvent; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.test.uiautomator.By; Loading @@ -44,15 +45,18 @@ import androidx.test.uiautomator.Configurator; import androidx.test.uiautomator.UiDevice; import androidx.test.uiautomator.UiObject2; import androidx.test.uiautomator.Until; import com.android.launcher3.TestProtocol; import com.android.systemui.shared.system.QuickStepContract; import org.junit.Assert; import java.io.IOException; import java.lang.ref.WeakReference; import java.util.Deque; import java.util.LinkedList; import java.util.List; import java.util.concurrent.TimeoutException; import org.junit.Assert; /** * The main tapl object. The only object that can be explicitly constructed by the using code. It Loading Loading @@ -149,6 +153,8 @@ public final class LauncherInstrumentation { } catch (IOException e) { fail(e.toString()); } assertTrue("Phone is locked", !hasSystemUiObject("keyguard_status_view")); } Context getContext() { Loading Loading @@ -245,10 +251,10 @@ public final class LauncherInstrumentation { final NavigationModel navigationModel = getNavigationModel(); assertTrue("Presence of recents button doesn't match the interaction mode", (navigationModel == NavigationModel.THREE_BUTTON) == mDevice.hasObject(By.res(SYSTEMUI_PACKAGE, "recent_apps"))); hasSystemUiObject("recent_apps")); assertTrue("Presence of home button doesn't match the interaction mode", (navigationModel != NavigationModel.ZERO_BUTTON) == mDevice.hasObject(By.res(SYSTEMUI_PACKAGE, "home"))); hasSystemUiObject("home")); log("verifyContainerType: " + containerType); try (Closable c = addContextLayer( Loading Loading @@ -477,6 +483,10 @@ public final class LauncherInstrumentation { WAIT_TIME_MS)); } private boolean hasSystemUiObject(String resId) { return mDevice.hasObject(By.res(SYSTEMUI_PACKAGE, resId)); } @NonNull UiObject2 waitForSystemUiObject(String resId) { final UiObject2 object = mDevice.wait( Loading Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +13 −3 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.view.MotionEvent; import android.view.Surface; import android.view.ViewConfiguration; import android.view.accessibility.AccessibilityEvent; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.test.uiautomator.By; Loading @@ -44,15 +45,18 @@ import androidx.test.uiautomator.Configurator; import androidx.test.uiautomator.UiDevice; import androidx.test.uiautomator.UiObject2; import androidx.test.uiautomator.Until; import com.android.launcher3.TestProtocol; import com.android.systemui.shared.system.QuickStepContract; import org.junit.Assert; import java.io.IOException; import java.lang.ref.WeakReference; import java.util.Deque; import java.util.LinkedList; import java.util.List; import java.util.concurrent.TimeoutException; import org.junit.Assert; /** * The main tapl object. The only object that can be explicitly constructed by the using code. It Loading Loading @@ -149,6 +153,8 @@ public final class LauncherInstrumentation { } catch (IOException e) { fail(e.toString()); } assertTrue("Phone is locked", !hasSystemUiObject("keyguard_status_view")); } Context getContext() { Loading Loading @@ -245,10 +251,10 @@ public final class LauncherInstrumentation { final NavigationModel navigationModel = getNavigationModel(); assertTrue("Presence of recents button doesn't match the interaction mode", (navigationModel == NavigationModel.THREE_BUTTON) == mDevice.hasObject(By.res(SYSTEMUI_PACKAGE, "recent_apps"))); hasSystemUiObject("recent_apps")); assertTrue("Presence of home button doesn't match the interaction mode", (navigationModel != NavigationModel.ZERO_BUTTON) == mDevice.hasObject(By.res(SYSTEMUI_PACKAGE, "home"))); hasSystemUiObject("home")); log("verifyContainerType: " + containerType); try (Closable c = addContextLayer( Loading Loading @@ -477,6 +483,10 @@ public final class LauncherInstrumentation { WAIT_TIME_MS)); } private boolean hasSystemUiObject(String resId) { return mDevice.hasObject(By.res(SYSTEMUI_PACKAGE, resId)); } @NonNull UiObject2 waitForSystemUiObject(String resId) { final UiObject2 object = mDevice.wait( Loading