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

            options.TransportFactory = (url, opt, cancellationToken) =>
            {
                customTransportCreated = true;
                return(WebSocketTransport.DefaultTransportFactory(url, opt, cancellationToken));
            };

            using (await Puppeteer.LaunchAsync(options, TestConstants.LoggerFactory))
            {
                Assert.True(customTransportCreated);
            }
        }
コード例 #2
0
        public async Task ShouldSupportCustomTransport()
        {
            var customTransportCreated = false;
            var options = new ConnectOptions()
            {
                BrowserWSEndpoint = Browser.WebSocketEndpoint,
                TransportFactory  = (url, opt, cancellationToken) =>
                {
                    customTransportCreated = true;
                    return(WebSocketTransport.DefaultTransportFactory(url, opt, cancellationToken));
                }
            };

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