MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / waitExecutionFor

Function waitExecutionFor

tests/utils.ts:592–607  ·  view source on GitHub ↗
(
  func: () => Promise<void>,
  timeout: number,
)

Source from the content-addressed store, hash-verified

590}
591
592export async function waitExecutionFor(
593 func: () => Promise<void>,
594 timeout: number,
595): Promise<void> {
596 const start = Date.now();
597 while (Date.now() - start < 10000) {
598 try {
599 await func();
600 return;
601 } catch {
602 await new Promise(resolve => setTimeout(resolve, 100)); // wait and retry
603 }
604 }
605
606 throw new Error(`Timeout of ${timeout} reached.`);
607}
608
609export function createTempDir(
610 prefix = 'chrome-devtools-test-',

Callers 3

waitForMessageFunction · 0.85
console.test.tsFile · 0.85

Calls

no outgoing calls

Tested by 1

waitForMessageFunction · 0.68