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

Commit 72b8b079 authored by Joshua Trask's avatar Joshua Trask
Browse files

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
parent 25a98404
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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;
    }
}