diff options
author | Jason Monk <jmonk@google.com> | 2016-12-16 10:09:41 -0500 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2017-03-15 16:02:53 +0000 |
commit | 485c4374832af732e073c9656e5422ceb7d1635d (patch) | |
tree | 76fea7b9473b7cbd2ec8ed20f61bf86ff9d3d47a /dexmaker/pom.xml | |
parent | 7d2fa18cfd9d254e73e31ca4674ee315d369f1a4 (diff) | |
download | dexmaker-485c4374832af732e073c9656e5422ceb7d1635d.tar.gz |
Hacks to allow mocking of package private classes
2 things are required to allow mocking for package private classes.
First is creating the mock in the same class as the base, that part
is simple and seems to have no effect. The second is to have a matching
ClassLoader as the source class.
To make the classloader match, instead of generating a new ClassLoader,
add the new dex to the existing one and share the base class's ClassLoader.
Since this is a persistent change and could affect the process, it will be
opt-in through setting a system property.
This also appears to have unintended speedup in the tests I was testing,
possible through cache fixes or brokenness.
Test: Add System.setProperty("dexmaker.share_classloader", "true) to SysuiTestCase
then runtest systemui
(cherry picked from commit 31b974435499d3c9769ed6a746e946187f3be64f)
Change-Id: Ic871c5f48f5d5e38946b77de10d71ca4589c5daa
Merged-In: I566ff25dcdf53fbb8a0acd087724b068120f82c6
Diffstat (limited to 'dexmaker/pom.xml')
0 files changed, 0 insertions, 0 deletions