Add a content description to the app info button.
This resolves an issue where Talkback would call the app info button "unlabelled." Change-Id: I59d8639584c48d8eeb7640bdac3d18bc7667009f Fixes: 35338852 Test: Settings Robotest
This commit is contained in:
@@ -52,6 +52,7 @@ import org.robolectric.shadows.ShadowApplication;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyInt;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
@@ -233,6 +234,25 @@ public class AppHeaderControllerTest {
|
||||
.isEqualTo(View.GONE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bindButton_hasAppInfo_shouldHaveContentDescription() {
|
||||
final View appLinks = mLayoutInflater
|
||||
.inflate(R.layout.app_details, null /* root */);
|
||||
when(mFragment.getActivity()).thenReturn(mock(Activity.class));
|
||||
when(mContext.getString(eq(R.string.application_info_label))).thenReturn("App Info");
|
||||
|
||||
mController = new AppHeaderController(mContext, mFragment, appLinks);
|
||||
mController.setPackageName("123")
|
||||
.setUid(UserHandle.USER_SYSTEM)
|
||||
.setButtonActions(
|
||||
AppHeaderController.ActionType.ACTION_APP_INFO,
|
||||
AppHeaderController.ActionType.ACTION_NOTIF_PREFERENCE);
|
||||
mController.done();
|
||||
|
||||
assertThat(appLinks.findViewById(R.id.left_button).getContentDescription())
|
||||
.isEqualTo("App Info");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void bindButton_hasAppNotifIntent_shouldShowButton() {
|
||||
final View appLinks = mLayoutInflater
|
||||
|
Reference in New Issue
Block a user