Start font preloads before the layout bootstrap

This commit is contained in:
Jonathan Sykes
2026-10-08 04:12:16 +08:00
parent 46ec9ab2ca
commit fab444b7b8
2 changed files with 3 additions and 2 deletions

View File

@@ -76,6 +76,7 @@ test('only core scripts and styles remain eager; native fallback and active layo
assert.ok(html.indexOf('id="ytp-assets"')<html.indexOf('src="lazy.js"'));
assert.ok(html.indexOf('src="lazy.js"')<html.indexOf('</head>'));
assert.ok(html.indexOf('src="lazy.js"')<html.indexOf('rel="stylesheet"'),'head bootstrap must not wait for common CSS before requesting the selected layout');
assert.ok(html.indexOf('rel="preload"')<html.indexOf('src="lazy.js"'),'font preloads must start before the render-blocking bootstrap');
assert.deepEqual(JSON.parse(html.match(/id="ytp-assets">([^<]+)<\/script>/)[1]).groups,groups);
for(const name of ['playlist','settings','service-mode','lyrics-editor'])assert.ok(groups['feature:'+name].eager);
});