Add unit tests for taskbar overflow

The tests verify that number of icons in the task bar does not go beyond
the intended max number, that the taskbar remains centered as it hits
max number of icons, and maintains a minimal margin to the display
edges.
Also, has a test that the max naumber of icons and the taskbar margins
adapt as bubble bar visibility chages.

Adds a TestRule to mock the recents model in the taskbar window sandbox.
The mocked recents model is used to add fake running app icons to the
taskbar.

Bug: 368119679
Test: atest TaskbarOverflowTest
Flag: EXEMPT test only

Change-Id: I8d033c3e95d7c0a4b139502cd7d70882482117c0
This commit is contained in:
Toni Barzic
2024-11-12 17:25:39 +00:00
parent 9163f54158
commit 7a0191e753
4 changed files with 422 additions and 0 deletions
@@ -351,6 +351,11 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
OneShotPreDrawListener.add(mTaskbarView, listener);
}
@VisibleForTesting
int getMaxNumIconViews() {
return mTaskbarView.getMaxNumIconViews();
}
public Rect getIconLayoutVisualBounds() {
return mTaskbarView.getIconLayoutVisualBounds();
}