diff --git a/work/projects/macos-tests-worktrees-2026-10-14.md b/work/projects/macos-tests-worktrees-2026-10-14.md index 793dd9cb..f05c5d80 100644 --- a/work/projects/macos-tests-worktrees-2026-10-14.md +++ b/work/projects/macos-tests-worktrees-2026-10-14.md @@ -20,7 +20,7 @@ All worktrees are in `/Users/admin/DuckDuckGo/apple-browsers.git/`, on bra | `fix-address-bar-tests-flakiness` | origin/main `ddb1a82283` | Fix flaky `AddressBarTests`: mocks plus two leak root causes | Done, not committed | | `fix-ask-ai-chat-button-animation-leak` | origin/main `e698211924` | Ask AI Chat button animation leak plus regression test | In progress | | ~~`animation-leak-audit`~~ | origin/main `e698211924` | Audit `NSAnimationContext` completion handlers for leaks | Done: no leaks found; worktree and branch removed | -| `fix-fire-window-video-leak` | origin/main `e698211924` | Video keeps playing after a Fire Window is closed: reproduce, fix, regression test | In progress | +| `fix-fire-window-video-leak` | origin/main `e698211924` | Video keeps playing after a Fire Window is closed: reproduce, fix, regression test | Not reproduced: 4 guard tests only, no fix (see update below) | | `spm-browser-tests` (existing) | — | Source of the unit-test changes (SwiftPM variant) | Not changed | ## macos-unit-tests-no-app-delegate @@ -84,9 +84,35 @@ Checked with standalone AppKit harnesses (in the session scratchpad: `scratchpad ## fix-fire-window-video-leak -Branch `alex/fix-fire-window-video-leak`. In progress. Reproduce (with a test) the bug where video and audio keep playing after a Fire Window is closed, find the root cause, and fix it. The test must work whether the display is asleep or awake. +Branch `alex/fix-fire-window-video-leak`. Not reproduced; see the update below. ## Temporary and source worktrees - `spm-browser-tests` (`alex/spm-browser-tests`) is the existing source of the unit-test changes. Not changed. - A detached origin/main baseline in the session scratchpad was used to compare integration tests and has been removed. + + +## Update 2026-10-15: fix-fire-window-video-leak + +Status: **not reproduced, no fix.** + +- **Worktree:** `fix-fire-window-video-leak`, branch `alex/fix-fire-window-video-leak`, based on origin/main `e698211924`. +- **Changes:** only `macOS/IntegrationTests/Fire/FireWindowClosingTests.swift` (+153), with four synchronous guard tests: + - closing a Fire Window with media playing; + - closing it via the Fire popover; + - closing the last tab in a Fire Window; + - a regular window, for comparison. + + The media is a generated 440 Hz WAV served from `https://media.test` through `TestSchemeHandler`, so no network is involved. All the tests **pass on main** (35/35 with the display asleep, 7/7 with it awake), so they are guard tests, not regression tests. +- **What was tried:** + - Content: `data:` audio, `https` video, and a real H.264/AAC mp4. + - Close paths: `performClose` / Cmd+Shift+W, the Fire popover close action (directly and through the real `FireCoordinator`), Cmd+W on the last tab, and removing the tab. + - Conditions: a background tab, the Lottie fire animation, the display asleep and awake. + + In every case the Tab, WebView and window were released within 1–3 s, and media stopped. +- **How the check was validated:** with a deliberate Tab leak added in `animateBurningIfNeededAndClose`, the test failed. +- **Findings:** + 1. `async` tests mask releases: objects live until the test ends. The guard tests are synchronous for this reason. + 2. `DeallocationTests.testWhenLastTabClosed_windowIsDeallocated` crashes the test host when the display is asleep (probably `TabPreviewWindowController`) and passes when it is awake. This is a separate display-sleep flake. +- **Manual check in the app:** not possible, because `osascript` has no Accessibility access. +- **Next steps:** get the exact user steps (which site, PiP or fullscreen, a popup from the Fire Window, how the window was closed), or reproduce it by hand in a Debug build. The DEBUG deallocation checks will trigger on a leak.