Merge "Add tooltip for taskbar overflow button" into main

This commit is contained in:
Treehugger Robot
2025-06-05 09:02:43 -07:00
committed by Android (Google) Code Review
5 changed files with 30 additions and 1 deletions

View File

@@ -369,6 +369,8 @@ class TaskbarOverflowTest {
createDesktopTask(createdTasks)
assertThat(taskbarOverflowIconIndex).isEqualTo(initialIconCount)
assertThat(getOverflowIconTooltipText()).isEqualTo("Other recent apps")
tapOverflowIcon()
// Keyboard quick switch view is shown only after list of recent task is asynchronously
// retrieved from the recents model.
@@ -377,9 +379,11 @@ class TaskbarOverflowTest {
assertThat(getOnUiThread { keyboardQuickSwitchController.isShownFromTaskbar }).isTrue()
assertThat(getOnUiThread { keyboardQuickSwitchController.shownTaskIds() })
.containsExactlyElementsIn(0..<createdTasks)
assertThat(getOverflowIconTooltipText()).isNull()
tapOverflowIcon()
assertThat(keyboardQuickSwitchController.isShown).isFalse()
assertThat(getOverflowIconTooltipText()).isEqualTo("Other recent apps")
}
@Test
@@ -721,6 +725,14 @@ class TaskbarOverflowTest {
}
}
private fun getOverflowIconTooltipText(): String? {
return getOnUiThread {
val overflowIcon =
taskbarViewController.iconViews.firstOrNull { it is TaskbarOverflowView }
(overflowIcon as? TaskbarOverflowView)?.getTextForTooltipPopup()
}
}
/**
* Adds enough running apps for taskbar to enter overflow of `targetOverflowSize`, and verifies
* * max number of icons in the taskbar remains unchanged