File tree Expand file tree Collapse file tree
apps/desktop/src/main/browser-agent
packages/browser-protocol/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3100,28 +3100,27 @@ describe('credential protection', () => {
31003100
31013101 it ( 'gives a wait that runs to its timeout a full snapshot budget for its closing observation' , async ( ) => {
31023102 const contents = await openPage ( )
3103+ let finishSnapshot : ( value : unknown ) => void = ( ) => { }
31033104 vi . mocked ( contents . executeJavaScript ) . mockImplementation ( ( expression : string ) => {
31043105 if ( ! isPageCall ( expression , 'collectSnapshot' ) ) return Promise . resolve ( undefined )
3105- return new Promise ( ( resolve ) =>
3106- setTimeout (
3107- ( ) =>
3108- resolve ( {
3109- url : 'https://example.com/' ,
3110- title : 'Example' ,
3111- outline : '- heading "Order confirmed"' ,
3112- truncated : false ,
3113- refIds : [ ] ,
3114- refLineIndexes : { } ,
3115- nextElementId : 1_000 ,
3116- } ) ,
3117- 8_000
3118- )
3119- )
3106+ return new Promise ( ( resolve ) => {
3107+ finishSnapshot = resolve
3108+ } )
31203109 } )
31213110 vi . useFakeTimers ( )
31223111 try {
31233112 const waiting = driver . executeTool ( 'chat-test' , 'browser_wait_for' , { timeoutMs : 1_000 } )
3124- await vi . advanceTimersByTimeAsync ( 30_000 )
3113+ await vi . advanceTimersByTimeAsync ( 9_000 )
3114+ finishSnapshot ( {
3115+ url : 'https://example.com/' ,
3116+ title : 'Example' ,
3117+ outline : '- heading "Order confirmed"' ,
3118+ truncated : false ,
3119+ refIds : [ ] ,
3120+ refLineIndexes : { } ,
3121+ nextElementId : 1_000 ,
3122+ } )
3123+ await vi . advanceTimersByTimeAsync ( 1_000 )
31253124
31263125 expect ( await waiting ) . toMatchObject ( {
31273126 ok : true ,
Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ export type BrowserToolName = (typeof BROWSER_TOOL_NAMES)[number]
6565
6666const BROWSER_WAIT_FOR_DEFAULT_TIMEOUT_MS = 10_000
6767const BROWSER_WAIT_FOR_MAX_TIMEOUT_MS = 120_000
68- const BROWSER_WAIT_FOR_RENDERER_GRACE_MS = 15_000
68+ /** Covers the desktop's wait grace and the snapshot a wait ends with (25s), plus transport. */
69+ const BROWSER_WAIT_FOR_RENDERER_GRACE_MS = 30_000
6970export const BROWSER_TOOL_AUTHORIZATION_TIMEOUT_MS = 8_000
7071export const BROWSER_NAVIGATION_NATIVE_WATCHDOG_MS = 60_000
7172export const BROWSER_TOOL_QUEUE_WAIT_TIMEOUT_MS = BROWSER_NAVIGATION_NATIVE_WATCHDOG_MS
You can’t perform that action at this time.
0 commit comments