#50098: test: fix flaky macOS dock tests
Description of Change
This PR addresses some instability with the macos-arm 64 (darwin, 2) test suite in main, which seems to be commonly flaking on two dock tests:
- app module dock APIs dock.bounce should return a positive number for informational type (api-app-spec.ts)
- app module dock APIs dock.bounce should return a positive number for critical type (api-app-spec.ts)
This PR attempts to fix the dock tests by using app.isActive() instead of BrowserWindow.getFocusedWindow(). I think I may have uncovered an actual bug in the current autofill test while trying to deflake it, and included the fix here, but open to splitting that up in to a separate PR - I unfortunately haven't found a consistent fix for deflaking that test yet.
Checklist
- PR description included
- I have built and tested this PR
-
npm testpasses - tests are changed or added
- relevant API documentation, tutorials, and examples are updated and follow the documentation style guide
- PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: none
Backports
No Backports Requested
This pull request doesn't have any backports requested or created for older release branches.
What are backports?
Backports are copies of changes made to the main branch that are applied to older release branches. They ensure that bug fixes and important changes are available in maintained older versions of Electron.
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron