Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcc1ed47 authored by shawnlin's avatar shawnlin
Browse files

[DO NOT MERGE] Fixed LocalDisplayAdapterTest test failure

The test resources is a mock object so it's still possible to return
null in Resources#obtainTypedArray.

Add mocks for new added resource configs.

Bug: 194879684
Test: atest LocalDisplayAdapterTest
Change-Id: Ie5e09e8c43848273d696392da992b366d2514461
parent f04b9b82
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -134,6 +134,14 @@ public class LocalDisplayAdapterTest {
        when(mMockedResources.getFloat(com.android.internal.R.dimen
                .config_screenBrightnessSettingMaximumFloat))
                .thenReturn(BACKLIGHT_RANGE_ZERO_TO_ONE[1]);
        when(mMockedResources.getStringArray(R.array.config_displayUniqueIdArray))
                .thenReturn(new String[]{});
        TypedArray mockArray = mock(TypedArray.class);
        when(mockArray.length()).thenReturn(0);
        when(mMockedResources.obtainTypedArray(R.array.config_maskBuiltInDisplayCutoutArray))
                .thenReturn(mockArray);
        when(mMockedResources.obtainTypedArray(R.array.config_waterfallCutoutArray))
                .thenReturn(mockArray);
    }

    @After