Use runtime-resolved resource IDs in tests.
As described in b/211615608, the resource IDs asserted in the tests
didn't always align with those used in the ChooserWrapperActivity
(which inherits from the framework, and may not have been updated
since the last change to the resources -- even though that change
*is* picked up by the test). After this change, the tests no longer
depend on the framework version being up-to-date.
I'm not sure of a better way to solve this problem -- perhaps
we could either require the framework to be up-to-date before
the test is run, or else somehow write our tests in terms of the
last-built resource IDs on the device (instead of rebuilding those
IDs from source).
Bug: 211615608,208803748
Test: Manual test steps:
1. Add a new resource to the top of
frameworks/base/res/res/values/strings.xml. (May need to be
alphabetically early to disrupt existing ordering? I used
`aaapp_name`)
2. Run `atest ChooserActivityTest` and confirm that some UI
tests fail to find views for the `onText(int)` matcher (the
error message will show that it failed because it was using
a different resource name than the test asked for).
3. Either:
a. Patch this CL for a fix, or
b. `mp droid` to confirm this is because the framework was
out-of-date.
4. Re-run `atest ChooserActivityTest`; failures are fixed.
Change-Id: I3c1c4bf434d3a7fdc8e498cf112feb7d6ffbb016
1 file changed