Fix DCHECK in TestBackgroundPageFirstLoadObserver
Fix the problem with the DCHECK in TestBackgroundPageFirstLoadObserver::OnBackgroundHostCreated() being hit in case when the extension's background page host gets destroyed and recreated. The DCHECK was fired because the class didn't expect to observe more than one host at the same time. The underlying issue was that the class didn't stop observing the deleted host, leading to the DCHECK hit and a potential use-after-free (in tests). Bug: 1090941 Test: stress-test the "CertificateProviderApiTest.LazyBackgroundPage" browser test after applying crrev.com/c/2312817 Change-Id: I91cf8f3bb0126a04b63e3a73d3f39259c621f330 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2312799Reviewed-by:Istiaque Ahmed <lazyboy@chromium.org> Commit-Queue: Maksim Ivanov <emaxx@chromium.org> Cr-Commit-Position: refs/heads/master@{#791054}
Showing
Please register or sign in to comment