mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-22 16:10:50 +00:00
* feat(plugins): add isolated plugin host runtime * test(plugins): build runtime dependencies before tests * fix(plugins): harden runtime lifecycle and recovery * fix(plugins): harden runtime extension boundaries * fix(plugins): enforce runtime integrity boundaries * fix(plugins): await utility process exit * fix(plugins): harden utility process containment * fix(plugins): close runtime recovery gaps * fix(plugins): harden runtime lifecycle boundaries
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
"use strict";
|
|
|
|
const assert = require("node:assert/strict");
|
|
const test = require("node:test");
|
|
|
|
const windowManager = require("../windowManager.cjs");
|
|
|
|
function windowStub(id) {
|
|
return {
|
|
id,
|
|
isDestroyed: () => false,
|
|
webContents: {
|
|
id,
|
|
isCrashed: () => false,
|
|
isDestroyed: () => false,
|
|
},
|
|
};
|
|
}
|
|
|
|
test("lifecycle-only app windows are excluded from dirty-editor queries", (context) => {
|
|
const editorWindow = windowStub(101);
|
|
const terminalPopup = windowStub(102);
|
|
context.after(() => {
|
|
windowManager.unregisterAppContentWindow(editorWindow);
|
|
windowManager.unregisterAppContentWindow(terminalPopup);
|
|
});
|
|
|
|
windowManager.registerAppContentWindow(editorWindow, { queryDirtyEditors: true });
|
|
windowManager.registerAppContentWindow(terminalPopup);
|
|
|
|
assert.deepEqual(windowManager.getAppContentWindows(), [editorWindow, terminalPopup]);
|
|
assert.deepEqual(windowManager.getDirtyEditorWindows(), [editorWindow]);
|
|
windowManager.unregisterAppContentWindow(editorWindow);
|
|
assert.deepEqual(windowManager.getAppContentWindows(), [terminalPopup]);
|
|
assert.deepEqual(windowManager.getDirtyEditorWindows(), []);
|
|
});
|