-
- All Implemented Interfaces:
-
leakcanary.DetectLeaksAssert
public final class AndroidDetectLeaksAssert implements DetectLeaksAssert
Default DetectLeaksAssert implementation. Uses public helpers so you should be able to create our own implementation if needed.
Leak detection can be skipped by annotating tests with SkipLeakDetection which requires the TestDescriptionHolder test rule be applied and evaluating when assertNoLeaks is called.
For improved leak detection, you should consider updating LeakCanary.Config.leakingObjectFinder to
FilteringLeakingObjectFinder(AndroidObjectInspectors.appLeakingObjectFilters)when running in instrumentation tests. This changes leak detection from being incremental (based on AppWatcher to also scanning for all objects of known types in the heap).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classAndroidDetectLeaksAssert.Companion
-
Constructor Summary
Constructors Constructor Description AndroidDetectLeaksAssert(DetectLeaksInterceptor detectLeaksInterceptor, HeapAnalysisReporter heapAnalysisReporter)
-
Method Summary
Modifier and Type Method Description UnitassertNoLeaks(String tag)-
-
Constructor Detail
-
AndroidDetectLeaksAssert
AndroidDetectLeaksAssert(DetectLeaksInterceptor detectLeaksInterceptor, HeapAnalysisReporter heapAnalysisReporter)
-
-
Method Detail
-
assertNoLeaks
Unit assertNoLeaks(String tag)
-
-
-
-