Fix AppInfoDialogBrowserTest.InvokeUi_default failure (#35115)
Brave's tab_data.cc override was incorrectly marking all UNLOADED tabs as having discard status, including tabs that had never loaded (e.g. during browser initialization). This triggered TabIcon to attempt showing the IPH_DiscardRing promo before the browser's user education interface was initialized, causing a LOG(ERROR) and test failure on Windows ASAN builds. The fix adds a WasDiscarded() check so only tabs that were actually discarded get the discard status indicator, not tabs that simply haven't loaded yet. Resolves https://github.com/brave/brave-browser/issues/54037
This commit is contained in:
@@ -101,8 +101,10 @@ TabData TabData::FromTabInterface(tabs::TabInterface* tab) {
|
||||
}
|
||||
}
|
||||
|
||||
// Show which tabs are unloaded.
|
||||
if (!data.should_show_discard_status) {
|
||||
// Show which tabs are unloaded due to being discarded. Only mark tabs that
|
||||
// were actually discarded (WasDiscarded), not tabs that simply haven't loaded
|
||||
// yet (e.g. during browser initialization).
|
||||
if (!data.should_show_discard_status && contents->WasDiscarded()) {
|
||||
const auto loading_state =
|
||||
resource_coordinator::TabLoadTracker::Get()->GetLoadingState(contents);
|
||||
if (loading_state ==
|
||||
|
||||
Reference in New Issue
Block a user