fix(chromium): remove Debugger.paused event listener on coverage stop (#3252)

This commit is contained in:
Lars den Bakker 2020-08-01 00:45:29 +02:00 committed by GitHub
parent 7e8d03b050
commit 776f0192ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,8 +79,8 @@ class JSCoverage {
this._eventListeners = [
helper.addEventListener(this._client, 'Debugger.scriptParsed', this._onScriptParsed.bind(this)),
helper.addEventListener(this._client, 'Runtime.executionContextsCleared', this._onExecutionContextsCleared.bind(this)),
helper.addEventListener(this._client, 'Debugger.paused', this._onDebuggerPaused.bind(this)),
];
this._client.on('Debugger.paused', () => this._client.send('Debugger.resume'));
await Promise.all([
this._client.send('Profiler.enable'),
this._client.send('Profiler.startPreciseCoverage', { callCount: true, detailed: true }),
@ -89,6 +89,10 @@ class JSCoverage {
]);
}
_onDebuggerPaused() {
this._client.send('Debugger.resume');
}
_onExecutionContextsCleared() {
if (!this._resetOnNavigation)
return;