Add process cleanup logic to EventListenerMapTest.
This change simply cleans up the process that is created in SetUp(). Despite what the comment in SetUp() said, these process objects were not actually being cleaned up during BrowserContext shutdown. As a result these process objects stay alive between tests in a process global map managed by GetAllHosts() in render_process_host_imp.cc. While this doesn't cause any specific problems in the current tests, there is potential for flakiness because state is being maintained across test cases. It also exposes pointers to destroyed BrowserContexts via GetAllHosts() and can enable unexpected matches to old process objects if a previous BrowserContext pointer gets reused in a subsequent test. Explicitly cleaning up the process during TearDown() avoids these issues. Change-Id: Idf879b9f48bc31cfcda20c89925ea2d5f8ff1714 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2151337Reviewed-by:Istiaque Ahmed <lazyboy@chromium.org> Commit-Queue: Aaron Colwell <acolwell@chromium.org> Cr-Commit-Position: refs/heads/master@{#759426}
Showing
Please register or sign in to comment