Fix AAOS SystemUI Presubmit tests that are breaking.
Due to the newly added check in SystemBarConfig, tests can fail erroneously when testing behavior of when either top or bottom system bar is not enabled. Bug: 162599873 Bug: 165808744 Test: atest carsysui-presubmit --include-subdir passing. (5/5) Change-Id: Ife2ac4e746006c39eaf46cd0328c1639149891b2
This commit is contained in:
@@ -48,6 +48,10 @@ import org.mockito.MockitoAnnotations;
|
|||||||
@SmallTest
|
@SmallTest
|
||||||
public class CarNavigationBarControllerTest extends SysuiTestCase {
|
public class CarNavigationBarControllerTest extends SysuiTestCase {
|
||||||
|
|
||||||
|
private static final String TOP_NOTIFICATION_PANEL =
|
||||||
|
"com.android.systemui.car.notification.TopNotificationPanelViewMediator";
|
||||||
|
private static final String BOTTOM_NOTIFICATION_PANEL =
|
||||||
|
"com.android.systemui.car.notification.BottomNotificationPanelViewMediator";
|
||||||
private CarNavigationBarController mCarNavigationBar;
|
private CarNavigationBarController mCarNavigationBar;
|
||||||
private NavigationBarViewFactory mNavigationBarViewFactory;
|
private NavigationBarViewFactory mNavigationBarViewFactory;
|
||||||
private TestableResources mTestableResources;
|
private TestableResources mTestableResources;
|
||||||
@@ -117,6 +121,11 @@ public class CarNavigationBarControllerTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetTopWindow_topDisabled_returnsNull() {
|
public void testGetTopWindow_topDisabled_returnsNull() {
|
||||||
mTestableResources.addOverride(R.bool.config_enableTopNavigationBar, false);
|
mTestableResources.addOverride(R.bool.config_enableTopNavigationBar, false);
|
||||||
|
mTestableResources.addOverride(R.bool.config_enableBottomNavigationBar, true);
|
||||||
|
// If Top Notification Panel is used but top navigation bar is not enabled, SystemUI is
|
||||||
|
// expected to crash.
|
||||||
|
mTestableResources.addOverride(R.string.config_notificationPanelViewMediator,
|
||||||
|
BOTTOM_NOTIFICATION_PANEL);
|
||||||
mCarNavigationBar = createNavigationBarController();
|
mCarNavigationBar = createNavigationBarController();
|
||||||
|
|
||||||
ViewGroup window = mCarNavigationBar.getTopWindow();
|
ViewGroup window = mCarNavigationBar.getTopWindow();
|
||||||
@@ -148,6 +157,11 @@ public class CarNavigationBarControllerTest extends SysuiTestCase {
|
|||||||
@Test
|
@Test
|
||||||
public void testGetBottomWindow_bottomDisabled_returnsNull() {
|
public void testGetBottomWindow_bottomDisabled_returnsNull() {
|
||||||
mTestableResources.addOverride(R.bool.config_enableBottomNavigationBar, false);
|
mTestableResources.addOverride(R.bool.config_enableBottomNavigationBar, false);
|
||||||
|
mTestableResources.addOverride(R.bool.config_enableTopNavigationBar, true);
|
||||||
|
// If Bottom Notification Panel is used but bottom navigation bar is not enabled,
|
||||||
|
// SystemUI is expected to crash.
|
||||||
|
mTestableResources.addOverride(R.string.config_notificationPanelViewMediator,
|
||||||
|
TOP_NOTIFICATION_PANEL);
|
||||||
mCarNavigationBar = createNavigationBarController();
|
mCarNavigationBar = createNavigationBarController();
|
||||||
|
|
||||||
ViewGroup window = mCarNavigationBar.getBottomWindow();
|
ViewGroup window = mCarNavigationBar.getBottomWindow();
|
||||||
|
|||||||
Reference in New Issue
Block a user