NetzenbotandSimon Hong cf867366ac Remove minimize/restore from split view modal dialog test (#34347)
* Fix split view tab_is_active_ correction for permission manager

The BRAVE_PERMISSION_REQUEST_MANAGER_ON_VISIBILITY_CHANGED macro that
calls UpdateTabIsHiddenWithTabActivationState() is unreachable on
desktop because OnVisibilityChanged() returns early when
tab_subscriptions_ is not empty. This means OnTabActiveStateChanged()
was calling OnVisibilityChanged() expecting the correction to run, but
it never did on desktop.

Additionally, UpdateTabIsHiddenWithTabActivationState() only corrected
tab_is_active_ in one direction (true->false for inactive split tabs)
but not the reverse (false->true for the active split tab).

Fix by calling UpdateTabIsHiddenWithTabActivationState() directly from
OnTabActiveStateChanged() instead of through the unreachable macro, and
make the correction bidirectional so tab_is_active_ always matches the
split view activation state.

Resolves https://github.com/brave/brave-browser/issues/53276

* Fix IsWebContentsVisible for split view dialog visibility

Address review feedback: the test failure is about web modal dialog
visibility, not permission bubbles. The root cause is that after
Minimize()+Restore(), platform_util::IsVisible() can temporarily
return false for the active split tab. This caused the Brave macro
in WebContentsModalDialogManager::OnVisibilityChanged() to swallow
the HIDDEN->VISIBLE transition, preventing ShowNextDialog() from
being called.

Fix: Use tab->IsActivated() as the source of truth for split view
tabs in BraveBrowser::IsWebContentsVisible(), which is always
accurate regardless of platform visibility timing. Revert the
PermissionRequestManager changes from the previous attempt.

Resolves brave/brave-browser#53276

* Updated test code

Removed window minimize/restored state during the test.
This window change is not important factor for split tab's
modal dialog test.
Claude code suspects that minimize/retored state change could
make platform_util::IsVisible(). Let's see this intermittent test
failure happens again w/o window state change.

---------

Co-authored-by: Simon Hong <shong@brave.com>
2026-03-04 17:43:26 -05:00
2026-03-02 17:18:22 +00:00
2026-03-03 14:24:22 +00:00

Brave Core

Brave Core is a set of changes, APIs, and scripts used for customizing Chromium to make the Brave browser. Please also check https://github.com/brave/brave-browser

Follow @brave on Twitter for important announcements.

Resources

Community

You can ask questions and interact with the community in the following locations:

S
Description
No description provided
Readme MPL-2.0
3.8 GiB
Languages
C++ 36.9%
HTML 31.6%
Swift 9.4%
TypeScript 9%
Java 4.8%
Other 8.1%