feat: 按任务管理比特浏览器临时窗口

This commit is contained in:
2026-09-23 18:15:08 +08:00
parent 04309f60c7
commit ff2879f102
15 changed files with 577 additions and 226 deletions
+8 -2
View File
@@ -90,8 +90,14 @@ async function waitUntil(predicate, timeoutMs = 1000) {
const importStart = taskRunnerSource.indexOf("case 'import_setup'");
const importEnd = taskRunnerSource.indexOf('\n default:', importStart);
const importSection = taskRunnerSource.slice(importStart, importEnd);
assert.ok(importSection.includes('runImportBrowserBatch(readyAccounts'), '导入流程应接入并发批处理器');
assert.ok(!importSection.includes('setTimeout(r, 600)'), '导入流程不应再为每个账号固定等待 600ms');
const disabledAt = importSection.indexOf('导入后自动创建比特浏览器已停用');
const firstBreakAt = importSection.indexOf('break;');
const legacyBrowserBatchAt = importSection.indexOf('runImportBrowserBatch(readyAccounts');
assert.ok(disabledAt >= 0, '导入初始化任务必须明确停用浏览器创建');
assert.ok(firstBreakAt > disabledAt, '停用提示后应立即结束导入初始化任务');
assert.ok(legacyBrowserBatchAt === -1 || firstBreakAt < legacyBrowserBatchAt, '旧浏览器批处理代码不得再被执行');
const appSource = fs.readFileSync(path.join(__dirname, '../public/app.js'), 'utf8');
assert.ok(!appSource.includes('_runImportSetup('), '前端导入成功后不得启动浏览器初始化任务');
console.log('import_browser_batch_service.test.js PASS');
})().catch(error => {