[aim][popup] Remove visibility assert from setPreserveContextOnClose_ Addresses the "Uncaught Error: Assertion failed (chrome://omnibox-popup.top-chrome)" JS error reports tracked in https://crbug.com/558982300, which started in M152. crrev.com/c/8071569 made `addContext_()` reset `preserveContextOnClose_` by calling `setPreserveContextOnClose_(false)`. That method asserts `document.visibilityState === 'visible'`. The browser sends `AddContext` whenever the popup state is `kAim` (`OmniboxContextMenuController::UpdateSearchboxContext()`), not based on actual page visibility. The renderer's visibility state is updated over a separate channel and can also be affected by occlusion, so `AddContext` can be delivered while the document is hidden, and the assert throws. The browser-initiated `SetPreserveContextOnClose` call is gated the same way, so the assert does not describe a real invariant. Remove it. Adds a test that delivers `addContext` while the document is hidden; it fails with "Assertion failed" without this fix. Bug: 558982300 Change-Id: I4ff09e9b6c89340fa87728c6057bdbd18ce60b3a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8466742 Auto-Submit: Aviv Kiss <avivkiss@google.com> Reviewed-by: Paul Adedeji <pauladedeji@google.com> Commit-Queue: Paul Adedeji <pauladedeji@google.com> Cr-Commit-Position: refs/heads/main@{#1707088}
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.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.