• Joe Downing's avatar
    Revert "Make DestructorAtExit LazyInstances leak." · 0d4683df
    Joe Downing authored
    This reverts commit 1b97e93c.
    
    Reason for revert: Speculative revert due to Linux TSAN unittest errors:
    https://uberchromegw.corp.google.com/i/chromium.memory/builders/Linux%20TSan%20Tests/builds/17057
    
    Original change's description:
    > Make DestructorAtExit LazyInstances leak.
    > 
    > This means that tests may no longer rely on LazyInstance<T> to clean
    > up global state between tests. Tests that depend on globals but need
    > a clean test environment should use explicit test hooks to reset this
    > state.
    > 
    > Only one test depends on DestructorAtExit for correct functionality.
    > cast_audio_backend_unittests creates several mocks that are owned by a
    > base::LazyInstance. Since Gmock verifies expectations in destructors,
    > switching all LazyInstances to leaky ones breaks this verification.
    > The solution is to manually verify and check the expectations at the
    > end of the test.
    > 
    > Note that while the mock objects are annotated as leaked for Gmock,
    > that does not mean the cast_audio_backend_unittests will leak
    > arbitrary amounts of memory. The test fixture already configures
    > StreamMixer for each test run; this setup will clear up any leftover
    > objects from the previous test.
    > 
    > DestructorAtExit will be removed in a followup.
    > 
    > Bug: 698982
    > Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
    > Change-Id: I822ce507dbb98067a788466e7c8fcc96c3a64ef9
    > Reviewed-on: https://chromium-review.googlesource.com/874994
    > Commit-Queue: Daniel Cheng <dcheng@chromium.org>
    > Reviewed-by: Kenneth MacKay <kmackay@chromium.org>
    > Reviewed-by: Gabriel Charette <gab@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#531385}
    
    TBR=dcheng@chromium.org,gab@chromium.org,kmackay@chromium.org
    
    Change-Id: Ief1f9169caa0ff81e2c095df0a0520a71d7640a1
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: 698982
    Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
    Reviewed-on: https://chromium-review.googlesource.com/882506Reviewed-by: default avatarJoe Downing <joedow@chromium.org>
    Commit-Queue: Joe Downing <joedow@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#531398}
    0d4683df
stream_mixer_unittest.cc 50.2 KB