fix(anime): harden browser playback and modal lifecycle

- Abort upstream fetches when clients disconnect
- Validate embedded modal readiness before opening
- Centralize browser IPC and window lifecycle
This commit is contained in:
2026-08-16 01:21:07 -07:00
parent 877f350353
commit 4300517da7
11 changed files with 413 additions and 217 deletions
+24
View File
@@ -330,6 +330,30 @@ for (const platform of ['darwin', 'win32'] as const) {
});
}
test('priming and IPC delivery both accept an unset document-loaded flag', () => {
const modalWindow = createMockWindow();
Reflect.deleteProperty(modalWindow, '__subminerOverlayDocumentLoaded');
const runtime = createOverlayModalRuntimeService(
{
getMainWindow: () => null,
getModalWindow: () => modalWindow as never,
createModalWindow: () => modalWindow as never,
getModalGeometry: () => ({ x: 0, y: 0, width: 400, height: 300 }),
setModalWindowBounds: () => {},
},
{ platform: 'darwin' },
);
assert.equal(runtime.primeModalWindow(), true);
assert.equal(
runtime.sendToActiveOverlayWindow('runtime-options:open', undefined, {
restoreOnModalClose: 'runtime-options',
}),
true,
);
assert.deepEqual(modalWindow.sent, [['runtime-options:open']]);
});
test('anime browser modal keeps its document warm across close on Linux', () => {
const modalWindow = createMockWindow();
const runtime = createOverlayModalRuntimeService(