Exemplo n.º 1
0
        internal async Task StartAsync(JSCoverageStartOptions options)
        {
            if (_enabled)
            {
                throw new InvalidOperationException("JSCoverage is already enabled");
            }

            _resetOnNavigation = options.ResetOnNavigation;
            _enabled           = true;
            _scriptURLs.Clear();
            _scriptSources.Clear();

            _client.MessageReceived += client_MessageReceived;

            await Task.WhenAll(
                _client.SendAsync("Profiler.enable"),
                _client.SendAsync("Profiler.startPreciseCoverage", new { callCount = false, detailed = true }),
                _client.SendAsync("Debugger.enable"),
                _client.SendAsync("Debugger.setSkipAllPauses", new { skip = true })
                );
        }
Exemplo n.º 2
0
 /// <summary>
 /// Starts JS coverage
 /// </summary>
 /// <param name="options">Set of configurable options for coverage</param>
 /// <returns>A task that resolves when coverage is started</returns>
 public Task StartJSCoverageAsync(JSCoverageStartOptions options = null)
 => _jsCoverage.StartAsync(options ?? new JSCoverageStartOptions());