1+ import { SEEK_SETTLES_BEFORE_PROTOCOL_TIMEOUT_MS } from "./captureTimeout.js" ;
12import { mkdtempSync , readFileSync , rmSync , writeFileSync } from "node:fs" ;
23import { tmpdir } from "node:os" ;
34import { dirname , join } from "node:path" ;
@@ -111,7 +112,10 @@ describe("seekCompositionTimeline", () => {
111112 expect ( waitForFunction ) . not . toHaveBeenCalled ( ) ;
112113 expect ( evaluate ) . toHaveBeenCalledTimes ( 4 ) ;
113114 expect ( evaluate ) . toHaveBeenNthCalledWith ( 1 , expect . any ( Function ) , 1.25 , false , false , false ) ;
114- expect ( evaluate ) . toHaveBeenNthCalledWith ( 2 , expect . any ( Function ) , { videoFrames : true } ) ;
115+ expect ( evaluate ) . toHaveBeenNthCalledWith ( 2 , expect . any ( Function ) , {
116+ videoFrames : true ,
117+ timeoutMs : SEEK_SETTLES_BEFORE_PROTOCOL_TIMEOUT_MS ,
118+ } ) ;
115119 expect ( evaluate . mock . calls [ 2 ] ?. [ 0 ] ) . toContain ( "window.setTimeout(finish, 100)" ) ;
116120 // Post-seek font settle: a seek can reveal glyphs whose unicode-range
117121 // subsets only start loading after the next layout (CJK snapshot reports).
@@ -126,7 +130,10 @@ describe("seekCompositionTimeline", () => {
126130 expect ( evaluate ) . toHaveBeenNthCalledWith ( 1 , expect . any ( Function ) , 1.25 , false , false , false ) ;
127131
128132 await settleCompositionSeek ( page ) ;
129- expect ( evaluate ) . toHaveBeenNthCalledWith ( 2 , expect . any ( Function ) , { videoFrames : true } ) ;
133+ expect ( evaluate ) . toHaveBeenNthCalledWith ( 2 , expect . any ( Function ) , {
134+ videoFrames : true ,
135+ timeoutMs : SEEK_SETTLES_BEFORE_PROTOCOL_TIMEOUT_MS ,
136+ } ) ;
130137 expect ( evaluate ) . toHaveBeenCalledTimes ( 4 ) ;
131138 } ) ;
132139
@@ -245,7 +252,10 @@ describe("seekCompositionTimeline", () => {
245252
246253 expect ( evaluate ) . toHaveBeenCalledTimes ( 3 ) ;
247254 expect ( evaluate ) . toHaveBeenNthCalledWith ( 1 , expect . any ( Function ) , 4 , true , false , false ) ;
248- expect ( evaluate ) . toHaveBeenNthCalledWith ( 2 , expect . any ( Function ) , { videoFrames : true } ) ;
255+ expect ( evaluate ) . toHaveBeenNthCalledWith ( 2 , expect . any ( Function ) , {
256+ videoFrames : true ,
257+ timeoutMs : SEEK_SETTLES_BEFORE_PROTOCOL_TIMEOUT_MS ,
258+ } ) ;
249259 expect ( evaluate ) . toHaveBeenNthCalledWith ( 3 , expect . any ( Function ) , { ms : 500 , frames : 2 } ) ;
250260
251261 const frames : ( ( ) => void ) [ ] = [ ] ;
@@ -543,8 +553,12 @@ describe("DENSE_GEOMETRY_SEEK_OPTIONS", () => {
543553 return barrier . mock . calls ;
544554 } ;
545555
546- expect ( await barrierCalls ( DENSE_GEOMETRY_SEEK_OPTIONS ) ) . toEqual ( [ [ { videoFrames : false } ] ] ) ;
547- expect ( await barrierCalls ( AUDIT_SEEK_OPTIONS ) ) . toEqual ( [ [ { videoFrames : true } ] ] ) ;
556+ expect ( await barrierCalls ( DENSE_GEOMETRY_SEEK_OPTIONS ) ) . toEqual ( [
557+ [ { videoFrames : false , timeoutMs : SEEK_SETTLES_BEFORE_PROTOCOL_TIMEOUT_MS } ] ,
558+ ] ) ;
559+ expect ( await barrierCalls ( AUDIT_SEEK_OPTIONS ) ) . toEqual ( [
560+ [ { videoFrames : true , timeoutMs : SEEK_SETTLES_BEFORE_PROTOCOL_TIMEOUT_MS } ] ,
561+ ] ) ;
548562 } ) ;
549563
550564 it ( "is genuinely geometry-only — no post-seek settle waits at the 600-sample cap" , ( ) => {
0 commit comments