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

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

            _client.MessageReceived += Client_MessageReceived;

            return(Task.WhenAll(
                       _client.SendAsync("Profiler.enable"),
                       _client.SendAsync("Profiler.startPreciseCoverage", new ProfilerStartPreciseCoverageRequest
            {
                CallCount = false,
                Detailed = true
            }),
                       _client.SendAsync("Debugger.enable"),
                       _client.SendAsync("Debugger.setSkipAllPauses", new DebuggerSetSkipAllPausesRequest {
                Skip = true
            })
                       ));
        }
Exemplo n.º 2
0
        internal Task StartAsync(CoverageStartOptions options)
        {
            if (_enabled)
            {
                throw new InvalidOperationException("CSSCoverage is already enabled");
            }

            _resetOnNavigation = options.ResetOnNavigation;
            _enabled           = true;
            _stylesheetURLs.Clear();
            _stylesheetSources.Clear();

            _client.MessageReceived += Client_MessageReceived;

            return(Task.WhenAll(
                       _client.SendAsync("DOM.enable"),
                       _client.SendAsync("CSS.enable"),
                       _client.SendAsync("CSS.startRuleUsageTracking")));
        }
Exemplo n.º 3
0
        internal async Task StartAsync(CoverageStartOptions 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.º 4
0
 /// <summary>
 /// Starts CSS coverage
 /// </summary>
 /// <param name="options">Set of configurable options for coverage</param>
 /// <returns>A task that resolves when coverage is started</returns>
 public Task StartCSSCoverageAsync(CoverageStartOptions options = null)
 => _cssCoverage.StartAsync(options ?? new CoverageStartOptions());