예제 #1
0
        private async void Client_MessageReceived(object sender, MessageEventArgs e)
        {
            try
            {
                switch (e.MessageID)
                {
                case "Debugger.scriptParsed":
                    await OnScriptParsedAsync(e.MessageData.ToObject <DebuggerScriptParsedResponse>(true)).ConfigureAwait(false);

                    break;

                case "Runtime.executionContextsCleared":
                    OnExecutionContextsCleared();
                    break;
                }
            }
            catch (Exception ex)
            {
                var message = $"JSCoverage failed to process {e.MessageID}. {ex.Message}. {ex.StackTrace}";
                _client.Close(message);
            }
        }
예제 #2
0
        private async void Client_MessageReceived(object sender, MessageEventArgs e)
        {
            try
            {
                switch (e.MessageID)
                {
                case "CSS.styleSheetAdded":
                    await OnStyleSheetAddedAsync(e.MessageData.ToObject <CSSStyleSheetAddedResponse>(true)).ConfigureAwait(false);

                    break;

                case "Runtime.executionContextsCleared":
                    OnExecutionContextsCleared();
                    break;
                }
            }
            catch (Exception ex)
            {
                var message = $"CSSCoverage failed to process {e.MessageID}. {ex.Message}. {ex.StackTrace}";
                _logger.LogError(ex, message);
                _client.Close(message);
            }
        }