diff --git a/res/layout/content_protection_preference_fragment.xml b/res/layout/content_protection_preference_fragment.xml index 4c7352e38c4..8bf6582e716 100644 --- a/res/layout/content_protection_preference_fragment.xml +++ b/res/layout/content_protection_preference_fragment.xml @@ -17,6 +17,7 @@ allKeys = XmlTestUtils.getKeysFromPreferenceXml( mContext, R.layout.content_protection_preference_fragment); + final List nonIndexableKeysExpected = + List.of( + "content_protection_preference_top_intro", + "content_protection_preference_subpage_illustration", + "content_protection_preference_user_consent_work_profile_switch"); assertThat(allKeys).containsAtLeastElementsIn(nonIndexableKeys); + assertThat(nonIndexableKeys).isEqualTo(nonIndexableKeysExpected); } @Test @@ -132,7 +138,7 @@ public class ContentProtectionPreferenceFragmentTest { XmlTestUtils.getKeysFromPreferenceXml( mContext, R.layout.content_protection_preference_fragment); - assertThat(nonIndexableKeys).containsAnyIn(allKeys); + assertThat(nonIndexableKeys).isEqualTo(allKeys); } @Test