File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -481,7 +481,7 @@ export class McpContext implements Context {
481481 page . networkConditions ,
482482 ) ;
483483 page . pptrPage . setDefaultNavigationTimeout (
484- NAVIGATION_TIMEOUT * networkMultiplier ,
484+ NAVIGATION_TIMEOUT * networkMultiplier * cpuMultiplier ,
485485 ) ;
486486 }
487487
Original file line number Diff line number Diff line change @@ -209,6 +209,29 @@ describe('emulation', () => {
209209 } ) ;
210210 } ) ;
211211
212+ it ( 'scales the default navigation timeout with cpu throttling rate' , async ( ) => {
213+ await withMcpContext ( async ( response , context ) => {
214+ const page = context . getSelectedMcpPage ( ) ;
215+ let lastNavTimeout : number | undefined ;
216+ page . pptrPage . setDefaultNavigationTimeout = ( timeout : number ) => {
217+ lastNavTimeout = timeout ;
218+ } ;
219+
220+ await emulate . handler (
221+ {
222+ params : {
223+ cpuThrottlingRate : 4 ,
224+ } ,
225+ page,
226+ } ,
227+ response ,
228+ context ,
229+ ) ;
230+
231+ assert . strictEqual ( lastNavTimeout , 40000 ) ;
232+ } ) ;
233+ } ) ;
234+
212235 it ( 'disables cpu throttling' , async ( ) => {
213236 await withMcpContext ( async ( response , context ) => {
214237 await context . emulate ( {
You can’t perform that action at this time.
0 commit comments