Package 

Object DetectLeaksAfterTestSuccess.Companion

    • Method Summary

      Modifier and Type Method Description
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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())