Skip to content

Commit

Permalink
Add ctesque test for reading material resources.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 534493318
  • Loading branch information
brettchabot authored and Copybara-Service committed May 24, 2023
1 parent f2327ee commit af113b3
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -5,6 +5,7 @@
import static android.os.Build.VERSION_CODES.LOLLIPOP;
import static android.os.Build.VERSION_CODES.O;
import static android.os.Build.VERSION_CODES.Q;
import static android.os.Build.VERSION_CODES.TIRAMISU;
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
import static android.util.TypedValue.COMPLEX_UNIT_IN;
import static android.util.TypedValue.COMPLEX_UNIT_MM;
Expand Down Expand Up @@ -503,6 +504,15 @@ public void getIdentifier_nonExistantResource() {
assertThat(id).isEqualTo(0);
}

@Test
@SdkSuppress(minSdkVersion = LOLLIPOP)
// TODO: fix on android U
@Config(minSdk = LOLLIPOP, maxSdk = TIRAMISU)
public void getIdentifier_material() {
int id = Resources.getSystem().getIdentifier("btn_check_material_anim", "drawable", "android");
assertThat(id).isGreaterThan(0);
}

/**
* Public framework symbols are defined here:
* https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/public.xml
Expand Down

0 comments on commit af113b3

Please sign in to comment.