Skip to content

Fix and re-enable BlacklistedApis tests - #214

Open
the-felipeal wants to merge 1 commit into
linkedin:mainfrom
the-felipeal:fix_blaklist
Open

Fix and re-enable BlacklistedApis tests#214
the-felipeal wants to merge 1 commit into
linkedin:mainfrom
the-felipeal:fix_blaklist

Conversation

@the-felipeal

Copy link
Copy Markdown

Add informative error messages to all assertions and assumptions in BlacklistedApis.

In addition, fix test failures and re-enable the ignored test:

  • Tests expecting hidden API calls to throw exceptions fail when run in environments where ART does not enforce non-SDK API restrictions (such as debuggable packages or test runners passing --no-hidden-api-checks). Dynamically probe whether blacklisting is enforced via isBlacklistingEnforced() and skip via assumeTrue when it is not.
  • Re-enable callBlacklistedPublicMethodRealMethod by checking whether blacklisting is enforced or the app is debuggable, since ViewGroup.mChildren is no longer blocked on recent Android versions.
  • Declare throws Exception on all test methods.

Add informative error messages to all assertions and assumptions in
BlacklistedApis.

In addition, fix test failures and re-enable the ignored test:
- Tests expecting hidden API calls to throw exceptions fail when run
  in environments where ART does not enforce non-SDK API restrictions
  (such as debuggable packages or test runners passing
  --no-hidden-api-checks). Dynamically probe whether blacklisting is
  enforced via isBlacklistingEnforced() and skip via assumeTrue when
  it is not.
- Re-enable callBlacklistedPublicMethodRealMethod by checking whether
  blacklisting is enforced or the app is debuggable, since
  ViewGroup.mChildren is no longer blocked on recent Android versions.
- Declare throws Exception on all test methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant