Files
Netcatty/electron/backgroundWorkContinuity.test.cjs
T
陈大猫 90ab87efcc feat(editor): detached multi-tab window with acknowledged content handoff (#3606)
Add a detached multi-tab editor window with acknowledged content ownership, focused Monaco shortcuts, and shared close/save confirmation. Preserve source contents until handoff acknowledgement and block edits or incoming transfers during ownership changes.

Continuation of #3439. Original implementation by pplulee.

Co-authored-by: pplulee <hi@pplulee.me>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-08 18:11:23 +08:00

38 lines
1.2 KiB
JavaScript

const assert = require('node:assert/strict');
const { readFileSync } = require('node:fs');
const path = require('node:path');
const test = require('node:test');
const root = __dirname;
function read(relativePath) {
return readFileSync(path.join(root, relativePath), 'utf8');
}
test('terminal windows do not throttle work while hidden or unfocused', () => {
const windowSources = [
'bridges/windowManager/mainWindow.cjs',
'bridges/windowManager/terminalPopupWindow.cjs',
'bridges/windowManager/editorWindow.cjs',
];
for (const relativePath of windowSources) {
const source = read(relativePath);
assert.match(source, /webPreferences:\s*\{[\s\S]*?backgroundThrottling:\s*false/, relativePath);
}
});
test('non-terminal windows and the app itself do not block ordinary power saving', () => {
const sources = [
'main.cjs',
'bridges/windowManager/settingsWindow.cjs',
'bridges/windowManager/externalWindows.cjs',
'bridges/globalShortcutBridge.cjs',
];
for (const relativePath of sources) {
const source = read(relativePath);
assert.doesNotMatch(source, /backgroundThrottling:\s*false|powerSaveBlocker/, relativePath);
}
});