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

Function initializeAndLaunchBrowser

tests/shutdown.test.ts:113–134  ·  view source on GitHub ↗
(child: Server)

Source from the content-addressed store, hash-verified

111}
112
113async function initializeAndLaunchBrowser(child: Server): Promise<void> {
114 await rpc(child, {
115 method: 'initialize',
116 params: {
117 protocolVersion: '2024-11-05',
118 capabilities: {},
119 clientInfo: {name: 'shutdown-test', version: '0.0.1'},
120 },
121 });
122 notify(child, {method: 'notifications/initialized'});
123 // navigate_page forces a real Chrome launch — this is what reproduces
124 // the hang in #2116. Without an active Chrome subprocess, stdin EOF
125 // would close the event loop on its own and shutdown would look fine
126 // even with broken handlers.
127 await rpc(child, {
128 method: 'tools/call',
129 params: {
130 name: 'navigate_page',
131 arguments: {url: 'about:blank'},
132 },
133 });
134}
135
136describe('shutdown', () => {
137 it('exits within budget on stdin EOF after Chrome launch', async () => {

Callers 1

shutdown.test.tsFile · 0.85

Calls 2

rpcFunction · 0.85
notifyFunction · 0.85

Tested by

no test coverage detected