From 40075c9afdffbac08b284fe7a868f122e466b52e Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 17:18:28 +0900 Subject: [PATCH] =?UTF-8?q?test(browser):=20WebKit=EC=9D=98=20=E3=80=8Cpre?= =?UTF-8?q?load=EB=A5=BC=20=EB=AA=87=20=EC=B4=88=20=EC=95=88=EC=97=90=20?= =?UTF-8?q?=EC=95=88=20=EC=8D=BC=EB=8B=A4=E3=80=8D=20=EC=B6=94=EC=B8=A1=20?= =?UTF-8?q?=EA=B2=BD=EA=B3=A0=EB=A5=BC=20=EB=B0=9B=EC=95=84=EB=93=A4?= =?UTF-8?q?=EC=9D=B8=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WebKit은 load 이벤트 3초 뒤, 아직 쓰이지 않은 link preload마다 경고를 한 번 낸다. 공용 fixture는 경고를 실패로 센다. 그런데 desktop 호스트의 WebKit은 화면 하나를 여는 데 4초 안팎이 걸려, 곧 쓰일 청크에도 이 경고가 나온다. app-shell 시험이 3회 반복 중 한 번 이것으로 떨어졌다 (document-kind-labels-*.js). 템플릿(1103/11-09)과 같은 문장 정규식으로 이 경고만 무시한다. 한계: 템플릿은 이 추측 대신 「preload한 스크립트가 실제로 실행됐는지」를 모든 엔진에서 직접 검사한다(preload-use.ts, 시험 서버가 빌드 스크립트에 표시를 넣는다). 그 장치는 CSP·SW 시험의 응답 가로채기까지 같이 고쳐야 해서 옮기지 않았다. 그래서 쓰이지 않는 preload는 지금 어느 엔진에서도 잡히지 않는다. 다음 템플릿 동기화 때 옮길 일이다. 검증: app-shell을 포함한 다섯 시험을 세 엔진에서 3회 반복해 81건 통과. --- tests/support/browser/strict-browser-test.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/support/browser/strict-browser-test.ts b/tests/support/browser/strict-browser-test.ts index edde745..3a2d408 100644 --- a/tests/support/browser/strict-browser-test.ts +++ b/tests/support/browser/strict-browser-test.ts @@ -16,11 +16,22 @@ import { const FIREFOX_PRETENDARD_NAME_ORDER = /^\[JavaScript Warning: "downloadable font: name: name records are not sorted\. \(font-family: "Pretendard Variable" style:normal weight:45\.\.920 stretch:100 src index:0\) source: http:\/\/127\.0\.0\.1:\d+\/[\w./@-]*PretendardVariable(?:-[\w-]+)?\.woff2"\]$/u; +/** + * Template 1103/11-09. WebKit's guess, three seconds after the load event, + * that a preload went unused. It fires for chunks the page runs a moment + * later, which on the desktop host is often (WebKit takes about 4 s to open a + * page there). The template replaces it with a check of its own that every + * preloaded script ran (preload-use.ts); that check is not ported yet. + */ +const WEBKIT_UNUSED_PRELOAD_GUESS = + /^The resource \S+ was preloaded using link preload but not used within a few seconds from the window's load event\. Please make sure it wasn't preloaded for nothing\.$/u; + function ignoredConsole(message: ConsoleMessage) { return ( message.type() === "warning" && (message.text().includes("NO_COLOR") || - FIREFOX_PRETENDARD_NAME_ORDER.test(message.text())) + FIREFOX_PRETENDARD_NAME_ORDER.test(message.text()) || + WEBKIT_UNUSED_PRELOAD_GUESS.test(message.text())) ); }