/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/test/inspector/debugger/debugger-restore.js
43 строки
1 KB
Michaël Zasso
deps: update V8 to 12.2.281.27
31 мар 2024, 16:36
Не верифицирован
31 мар 2024, 16:36
09a8440
Код
Авторство
О чём код?
// Copyright 2023 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Flags: --no-stress-incremental-marking const {session, contextGroup, Protocol} = InspectorTest.start('Checks that Debugger agent correctly restore its state.'); const line = '// ' + '-'.repeat(512); const script = ` ${line} ${line} console.log('Hello from script'); `; function reconnect() { InspectorTest.log('will reconnect...'); session.reconnect(); } InspectorTest.runAsyncTestSuite([ async function testMaxScriptsCacheSize() { InspectorTest.log('Enable debugger agent with script cache of 4k'); await Protocol.Debugger.enable({ maxScriptsCacheSize: 4096 }); // 'script' fits into cache. reconnect(); InspectorTest.log('Evaluate large script'); contextGroup.addScript(script); const { params: { scriptId } } = await Protocol.Debugger.onceScriptParsed(); InspectorTest.log('Trigger GC'); await Protocol.HeapProfiler.collectGarbage(); InspectorTest.log('Request script content...'); const result = await Protocol.Debugger.getScriptSource({ scriptId }); if (result.error) { InspectorTest.log('Failed to retrieve script content'); return; } InspectorTest.log(`Received script content of length: ${result.result.scriptSource.length}`); }, ]);