commit | 56a9bbc9d8dff1ab89d8be3fb72d7447c6211cbb | [log] [tgz] |
---|---|---|
author | Anita Woodruff <awdf@chromium.org> | Thu Jul 26 14:21:00 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Jul 26 14:21:00 2018 |
tree | 8544047cb51612cccc771a290eba0a601ba483a7 | |
parent | 1dbc3a455c5f0420e2ba571ba9ee5819a172fc60 [diff] |
[Android Unit Tests] Fix flaky media notification test - Previously, MediaNotificationManagerServiceLifecycleTest had a test which failed when run individually, despite passing when all of the tests in that class were run, presumably due to the custom shadow observer picking up on notifications shown by other tests. - The only way I could get the test to always pass while still using the custom shadow observer was to reset the observer at the start of the test, and change the production code to notify via the non-compat NotificationManager. - However, turns out we can simply query Robolectric's built-in shadow of the notification manager, which has a convenient accessor method for the number of notifications it has shown, works for notifications posted to NotificationManagerCompat, and doesn't appear to need manual resetting. - Hence deleting the inferior MediaNotificationTestShadowNotificationManager Bug: 867879 Change-Id: I14639648c8c1f3e0740da4bb1877b9aa21424e33 Reviewed-on: https://chromium-review.googlesource.com/1151304 Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Commit-Queue: Anita Woodruff <awdf@chromium.org> Cr-Commit-Position: refs/heads/master@{#578292}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .