(debuggerParams)
| 46 | .then(() => InspectorTest.completeTest()); |
| 47 | |
| 48 | function trackScripts(debuggerParams) { |
| 49 | let {id: sessionId, Protocol} = contextGroup.connect(); |
| 50 | let scripts = []; |
| 51 | |
| 52 | Protocol.Debugger.enable(debuggerParams); |
| 53 | Protocol.Debugger.onScriptParsed(handleScriptParsed); |
| 54 | |
| 55 | async function loadScript({url, scriptId}) { |
| 56 | InspectorTest.log(`Session #${sessionId}: Script #${scripts.length} parsed. URL: ${url}.`); |
| 57 | let scriptSource; |
| 58 | ({result: {scriptSource}} = await Protocol.Debugger.getScriptSource({scriptId})); |
| 59 | InspectorTest.log(`Session #${sessionId}: Source for ${url}:`); |
| 60 | InspectorTest.log(scriptSource); |
| 61 | } |
| 62 | |
| 63 | function handleScriptParsed({params}) { |
| 64 | if (params.url.startsWith("wasm://")) { |
| 65 | scripts.push(loadScript(params)); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | return { |
| 70 | Protocol, |
| 71 | getScripts: () => Promise.all(scripts), |
| 72 | }; |
| 73 | } |
no test coverage detected