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
+13
View File
@@ -15,6 +15,7 @@ test('background imports shared source registry module', () => {
assert.match(source, /shared\/flow-registry\.js/);
assert.match(source, /shared\/settings-schema\.js/);
assert.match(source, /shared\/source-registry\.js/);
assert.match(source, /shared\/kiro-timeouts\.js/);
});
test('manifest loads shared source registry before content utils in static bundles', () => {
@@ -41,6 +42,18 @@ test('manifest no longer ships a static Kiro content bundle', () => {
assert.equal(hasStaticKiroBundle, false);
});
test('background injects shared Kiro timeout module before Kiro content scripts', () => {
const source = fs.readFileSync('background.js', 'utf8');
assert.match(
source,
/const KIRO_REGISTER_INJECT_FILES = \['shared\/source-registry\.js', 'shared\/kiro-timeouts\.js', 'content\/utils\.js', 'content\/kiro\/register-page\.js'\];/
);
assert.match(
source,
/const KIRO_DESKTOP_AUTHORIZE_INJECT_FILES = \['shared\/source-registry\.js', 'shared\/kiro-timeouts\.js', 'content\/utils\.js', 'content\/kiro\/desktop-authorize-page\.js'\];/
);
});
test('shared source registry exposes canonical Kiro sources and drivers', () => {
const registry = loadSourceRegistry();