Skip to content
Commit 6084b7a9 authored by Joshua Trask's avatar Joshua Trask
Browse files

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
parent 3f265b79
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment