Loading quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsControllerTest.kt +17 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.launcher3.taskbar.allapps import android.animation.AnimatorTestRule import android.content.ComponentName import android.content.Intent import android.os.Process Loading @@ -42,6 +43,7 @@ import org.junit.runner.RunWith class TaskbarAllAppsControllerTest { @get:Rule val taskbarUnitTestRule = TaskbarUnitTestRule() @get:Rule val animatorTestRule = AnimatorTestRule(this) @InjectController lateinit var allAppsController: TaskbarAllAppsController @InjectController lateinit var overlayController: TaskbarOverlayController Loading Loading @@ -166,6 +168,21 @@ class TaskbarAllAppsControllerTest { assertThat(btv.hasDot()).isTrue() } @Test fun testToggleSearch_searchEditTextFocused() { getInstrumentation().runOnMainSync { allAppsController.toggleSearch() } getInstrumentation().runOnMainSync { // All Apps is now attached to window. Open animation is posted but not started. } getInstrumentation().runOnMainSync { // Animation has started. Advance to end of animation. animatorTestRule.advanceTimeBy(overlayController.openDuration.toLong()) } val editText = overlayController.requestWindow().appsView.searchUiManager.editText assertThat(editText?.hasFocus()).isTrue() } private companion object { private val TEST_APPS = Array(16) { Loading Loading
quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsControllerTest.kt +17 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.launcher3.taskbar.allapps import android.animation.AnimatorTestRule import android.content.ComponentName import android.content.Intent import android.os.Process Loading @@ -42,6 +43,7 @@ import org.junit.runner.RunWith class TaskbarAllAppsControllerTest { @get:Rule val taskbarUnitTestRule = TaskbarUnitTestRule() @get:Rule val animatorTestRule = AnimatorTestRule(this) @InjectController lateinit var allAppsController: TaskbarAllAppsController @InjectController lateinit var overlayController: TaskbarOverlayController Loading Loading @@ -166,6 +168,21 @@ class TaskbarAllAppsControllerTest { assertThat(btv.hasDot()).isTrue() } @Test fun testToggleSearch_searchEditTextFocused() { getInstrumentation().runOnMainSync { allAppsController.toggleSearch() } getInstrumentation().runOnMainSync { // All Apps is now attached to window. Open animation is posted but not started. } getInstrumentation().runOnMainSync { // Animation has started. Advance to end of animation. animatorTestRule.advanceTimeBy(overlayController.openDuration.toLong()) } val editText = overlayController.requestWindow().appsView.searchUiManager.editText assertThat(editText?.hasFocus()).isTrue() } private companion object { private val TEST_APPS = Array(16) { Loading