• Wez's avatar
    Check that TaskScheduler is not leaked between tests, or test-cases. · 31890108
    Wez authored
    This is a reland of a2a4e75d with a
    work-around for cronet_tests' sharing libbase.so with libcronet.so in
    component builds.
    
    - Move some APIs off of base::TestSuite, that we unnecessarily public.
    - Rename the various internal TestEventListeners to express purpose.
    - Add CheckForLeakedGlobals check, and DisableCheckForLeakedGlobals API.
      The latter is called by the content::ContentTestSuiteBase, since the
      various browser- and ui-tests running under that suite base run more
      like the browser itself, and so are expected to let global singletons
      leak.
    
    If tests fail or flake due to this patch, then this indicates that the
    test is actually leaking global state that may break other tests if they
    happen to run in the same process, leading to hard-to-diagnose flakes.
    
    There are two main failure cases:
    If the test directly or indirectly uses TaskScheduler, but does not
    create a ScopedTaskEnvironment, then please add one to the test, or to
    the test base-class, as appropriate, to fix it.
    If the test suite cannot be fixed in this way then please add a call to
    DisableCheckForLeakedGlobals(), with a comment linking to a bug for the
    issue.
    
    TBR: gab, sky, mef
    Bug: 875486, 877355, 744567
    Change-Id: Iaea38d24ede271c248a3abb0b3f7ee931c2538f5
    Reviewed-on: https://chromium-review.googlesource.com/1187783Reviewed-by: default avatarWez <wez@chromium.org>
    Commit-Queue: Wez <wez@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#586065}
    31890108
chrome_test_launcher.cc 6.25 KB