commit | 68548c418a375bffddd6e4a8eee3c065c7411ce5 | [log] [tgz] |
---|---|---|
author | Aiden Benner <abenner@google.com> | Tue Nov 20 23:47:25 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Tue Nov 20 23:47:25 2018 |
tree | 819a0b4e8c73349ddf5164bca0092b0c0576d0db | |
parent | 94f0ac2e5b35cc381efb0a9e799e69f5346743a8 [diff] |
Add testing hooks to classes generated by the JniProcessor Adds an interface JniStaticTestMocker and an anonymous implementation in each generated class created by the JniProcessor. The TEST_HOOKS field contains a method that will set the mock that is used when testing is enabled. When testing is disabled, TEST_HOOKS will never be called and should be optimized away by proguard/R8. This should allow for generic JUnit rules that work with all static mockable 'proxy' natives. Bug: 898261 Change-Id: I026858957e7f98cbbe16da0772dc3e68d38717bb Reviewed-on: https://chromium-review.googlesource.com/c/1342805 Commit-Queue: Aiden Benner <abenner@google.com> Reviewed-by: Eric Stevenson <estevenson@chromium.org> Reviewed-by: agrieve <agrieve@chromium.org> Cr-Commit-Position: refs/heads/master@{#609855}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .