MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / stopChrome

Function stopChrome

scripts/e2e-webrtc-reliability.mjs:863–884  ·  view source on GitHub ↗
(chromeProcess)

Source from the content-addressed store, hash-verified

861}
862
863async function stopChrome(chromeProcess) {
864 if (chromeProcess.exitCode !== null || chromeProcess.signalCode !== null) {
865 return;
866 }
867 chromeProcess.kill("SIGTERM");
868 const exited = await Promise.race([
869 new Promise((resolve) => chromeProcess.once("exit", () => resolve(true))),
870 sleep(1500).then(() => false),
871 ]);
872 if (
873 exited ||
874 chromeProcess.exitCode !== null ||
875 chromeProcess.signalCode !== null
876 ) {
877 return;
878 }
879 chromeProcess.kill("SIGKILL");
880 await Promise.race([
881 new Promise((resolve) => chromeProcess.once("exit", resolve)),
882 sleep(1500),
883 ]);
884}
885
886async function waitForValue(cdp, expression, predicate, timeoutMs) {
887 const startedAt = Date.now();

Callers 1

Calls 1

sleepFunction · 0.70

Tested by

no test coverage detected