コード例 #1
0
        public async Task ShouldSupportCustomWebSocket()
        {
            var options             = TestConstants.DefaultBrowserOptions();
            var customSocketCreated = false;

            options.WebSocketFactory = (uri, socketOptions, cancellationToken) =>
            {
                customSocketCreated = true;
                return(WebSocketTransport.DefaultWebSocketFactory(uri, socketOptions, cancellationToken));
            };

            using (await Puppeteer.LaunchAsync(options, TestConstants.LoggerFactory))
            {
                Assert.True(customSocketCreated);
            }
        }
コード例 #2
0
        public async Task ShouldSupportCustomWebSocket()
        {
            var customSocketCreated = false;
            var options             = new ConnectOptions()
            {
                BrowserWSEndpoint = Browser.WebSocketEndpoint,
                WebSocketFactory  = (uri, socketOptions, cancellationToken) =>
                {
                    customSocketCreated = true;
                    return(WebSocketTransport.DefaultWebSocketFactory(uri, socketOptions, cancellationToken));
                }
            };

            await using (await Puppeteer.ConnectAsync(options, TestConstants.LoggerFactory))
            {
                Assert.True(customSocketCreated);
            }
        }