Fix(?) for some disabled ChooserActivityTest cases
These tests (testShortcutTarget{With,Without}ApplyAppLimits) are
currently disabled by @Ignore annotations, and I'm not re-enabling
them in this CL because I'm not sure that they won't flake -- I
just know that this was an easy (and understandable) fix when I
tried to run these tests locally, and I'd like to preserve that
fix for posterity.
Test: Re-enabled the tests and confirmed they passed only w/ fix
Bug: 208803748
Change-Id: I5268e3324d3cec9f6a72aee5de9ec1f06e45e987
This commit is contained in:
@@ -3073,8 +3073,15 @@ public class ChooserActivityTest {
|
||||
// framework code on the device is up-to-date.
|
||||
// TODO: is there a better way to do this? (Other than abandoning inheritance-based DI wrapper?)
|
||||
private int getRuntimeResourceId(String name, String defType) {
|
||||
int id = mActivityRule.getActivity().getResources().getIdentifier(name, defType, "android");
|
||||
int id = -1;
|
||||
if (ChooserActivityOverrideData.getInstance().resources != null) {
|
||||
id = ChooserActivityOverrideData.getInstance().resources.getIdentifier(
|
||||
name, defType, "android");
|
||||
} else {
|
||||
id = mActivityRule.getActivity().getResources().getIdentifier(name, defType, "android");
|
||||
}
|
||||
assertThat(id, greaterThan(0));
|
||||
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user