test: fix flaky macOS dock tests (#50098)

* test: fix flaky mac dock & autofill tests

* fix: add null checks for the parent widget before calling IsVisible()

* test: remove autofill test change (failing on Linux), keep crash fix

* chore: autofill updates from code review
This commit is contained in:
Keeley Hammond
2026-03-06 13:35:16 -08:00
committed by GitHub
parent 86f2c7cced
commit 3e0e1e4e84
2 changed files with 5 additions and 5 deletions

View File

@@ -67,9 +67,11 @@ AutofillPopupView::~AutofillPopupView() {
}
void AutofillPopupView::Show() {
if (!popup_)
return;
bool visible = parent_widget_->IsVisible();
visible = visible || view_proxy_;
if (!popup_ || !visible || parent_widget_->IsClosed())
if (!visible || parent_widget_->IsClosed())
return;
const bool initialize_widget = !GetWidget();

View File

@@ -1850,15 +1850,13 @@ describe('app module', () => {
});
it('should return a positive number for informational type', () => {
const appHasFocus = !!BrowserWindow.getFocusedWindow();
if (!appHasFocus) {
if (!app.isActive()) {
expect(app.dock?.bounce('informational')).to.be.at.least(0);
}
});
it('should return a positive number for critical type', () => {
const appHasFocus = !!BrowserWindow.getFocusedWindow();
if (!appHasFocus) {
if (!app.isActive()) {
expect(app.dock?.bounce('critical')).to.be.at.least(0);
}
});