diff options
Diffstat (limited to 'tests/tapl/com/android/launcher3/tapl/Workspace.java')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/Workspace.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java index ad2feb4b5..0aa36ddbb 100644 --- a/tests/tapl/com/android/launcher3/tapl/Workspace.java +++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java @@ -22,7 +22,6 @@ import static junit.framework.TestCase.assertTrue; import android.graphics.Point; import android.graphics.Rect; -import android.os.Bundle; import android.os.SystemClock; import android.view.KeyEvent; import android.view.MotionEvent; @@ -124,7 +123,7 @@ public final class Workspace extends Home { */ public void ensureWorkspaceIsScrollable() { final UiObject2 workspace = verifyActiveContainer(); - if (!isWorkspaceScrollable()) { + if (!isWorkspaceScrollable(workspace)) { try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer( "dragging icon to a second page of workspace to make it scrollable")) { dragIconToWorkspace( @@ -136,12 +135,12 @@ public final class Workspace extends Home { verifyActiveContainer(); } } - assertTrue("Home screen workspace didn't become scrollable", isWorkspaceScrollable()); + assertTrue("Home screen workspace didn't become scrollable", + isWorkspaceScrollable(workspace)); } - private boolean isWorkspaceScrollable() { - Bundle result = mLauncher.getTestInfo(TestProtocol.REQUEST_DOES_WORKSPACE_HAVE_SECOND_PAGE); - return result.getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, false); + private boolean isWorkspaceScrollable(UiObject2 workspace) { + return workspace.getChildCount() > 1; } @NonNull |