Disable LeakCanary for Robolectric tests

See 'For Robolectric users:' https://github.com/square/leakcanary
This commit is contained in:
Yusuke Matsubara 2017-11-03 11:26:56 +09:00
parent 10ac64d556
commit e317c369c1
2 changed files with 21 additions and 6 deletions

View file

@ -0,0 +1,11 @@
package fr.free.nrw.commons;
import com.squareup.leakcanary.RefWatcher;
// This class is automatically discovered by Robolectric
public class TestCommonsApplication extends CommonsApplication {
@Override protected RefWatcher setupLeakCanary() {
// No leakcanary in unit tests.
return RefWatcher.DISABLED;
}
}