feat: 添加共享 Kiro 超时模块并更新相关文件以使用统一的页面加载超时预算

This commit is contained in:
QLHazyCoder
2026-05-19 00:09:20 +08:00
parent 6c664ca5bc
commit e197d1e726
9 changed files with 195 additions and 29 deletions
@@ -46,3 +46,12 @@ test('parseDesktopCallbackUrl validates state and redirect port', () => {
);
assert.equal(badPort, null);
});
test('kiro desktop authorize runner uses a shared 3-minute page-load timeout budget', () => {
const source = fs.readFileSync('background/kiro/desktop-authorize-runner.js', 'utf8');
assert.match(source, /DEFAULT_KIRO_PAGE_LOAD_TIMEOUT_MS/);
assert.match(source, /createTimeoutBudget/);
assert.match(source, /resolveTimeoutBudget/);
assert.match(source, /timeoutBudget\.getRemainingMs\(1000\)/);
assert.match(source, /onRetryableError: buildDesktopRetryRecovery\(tabId, \{\s*\.\.\.options,\s*timeoutBudget,/);
});