@@ -1174,6 +1174,37 @@ describe("keepBrokenImageAborts", () => {
11741174 ] ) ;
11751175 } ) ;
11761176
1177+ it ( "reports a still-broken aborted image even when its URL ends in a video suffix" , async ( ) => {
1178+ const base = "http://127.0.0.1:3000/assets" ;
1179+ mountCanvasFixture ( `<img id="stuck" src="${ base } /plate.mkv">` ) ;
1180+ ( document . getElementById ( "stuck" ) as HTMLImageElement ) . decode = ( ) =>
1181+ Promise . reject ( new Error ( "broken" ) ) ;
1182+ const aborted = ( url : string , resourceType : string ) => ( {
1183+ url : ( ) => url ,
1184+ failure : ( ) => ( { errorText : "net::ERR_ABORTED" } ) ,
1185+ resourceType : ( ) => resourceType ,
1186+ } ) ;
1187+ const page = fakePage ( ) ;
1188+ page . on = vi . fn ( ( event : string , handler : ( request : ReturnType < typeof aborted > ) => void ) => {
1189+ if ( event !== "requestfailed" ) return ;
1190+ handler ( aborted ( `${ base } /plate.mkv` , "image" ) ) ;
1191+ handler ( aborted ( `${ base } /clip.mkv` , "fetch" ) ) ;
1192+ } ) ;
1193+ installSessionMock ( page ) ;
1194+
1195+ const result = await runBrowserCheck (
1196+ PROJECT ,
1197+ { ...DEFAULT_CHECK_OPTIONS , samples : 1 , contrast : false } ,
1198+ { kind : "none" } ,
1199+ runAuditGrid ,
1200+ ) ;
1201+
1202+ const failed = result . runtimeFindings . filter ( ( finding ) => finding . code === "request_failed" ) ;
1203+ expect ( failed . map ( ( finding ) => finding . message ) ) . toEqual ( [
1204+ "Failed to load assets/plate.mkv: net::ERR_ABORTED" ,
1205+ ] ) ;
1206+ } ) ;
1207+
11771208 it ( "does not report an aborted image whose reload is still pending at the cap" , async ( ) => {
11781209 const url = "http://127.0.0.1:3000/assets/slow.png" ;
11791210 mountCanvasFixture ( `<img id="slow" src="${ url } ">` ) ;
0 commit comments