(child: Server)
| 111 | } |
| 112 | |
| 113 | async 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 | |
| 136 | describe('shutdown', () => { |
| 137 | it('exits within budget on stdin EOF after Chrome launch', async () => { |
no test coverage detected