-
public class DetectLeaksAfterTestSuccess.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static DetectLeaksAfterTestSuccess.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final RuleChaindetectLeaksAfterTestSuccessWrapping(RuleChain $self, String tag, Function1<RuleChain, RuleChain> wrapped)A helper function to trigger leak detection twice during test tear down, before and after the tear down of a set of wrapped rule chains. -
-
Method Detail
-
detectLeaksAfterTestSuccessWrapping
final RuleChain detectLeaksAfterTestSuccessWrapping(RuleChain $self, String tag, Function1<RuleChain, RuleChain> wrapped)
A helper function to trigger leak detection twice during test tear down, before and after the tear down of a set of wrapped rule chains. For example, this can be useful to detect leaks both right before and right after the activity under test is destroyed. Before means we can detect detached fragment leaks that go away when the activity is destroyed. After means we can detect activity leaks.
RuleChain.outerRule(LoginRule()) .detectLeaksAfterTestSuccessWrapping("ActivitiesDestroyed") { around(ActivityScenarioRule(MyActivity::class.java)) } .around(LoadingScreenRule())
-
-
-
-