File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
PuppeteerSharp.Tests/TracingTests Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,15 @@ await Page.Tracing.StartAsync(new TracingOptions
122122 Assert . Equal ( trace , buf ) ;
123123 }
124124
125+ [ Fact ]
126+ public async Task ShouldWorkWithoutOptions ( )
127+ {
128+ await Page . Tracing . StartAsync ( ) ;
129+ await Page . GoToAsync ( TestConstants . ServerUrl + "/grid.html" ) ;
130+ var trace = await Page . Tracing . StopAsync ( ) ;
131+ Assert . NotNull ( trace ) ;
132+ }
133+
125134 [ Fact ]
126135 public async Task ShouldSupportABufferWithoutAPath ( )
127136 {
Original file line number Diff line number Diff line change @@ -54,21 +54,21 @@ internal Tracing(CDPSession client)
5454 /// </summary>
5555 /// <returns>Start task</returns>
5656 /// <param name="options">Tracing options</param>
57- public Task StartAsync ( TracingOptions options )
57+ public Task StartAsync ( TracingOptions options = null )
5858 {
5959 if ( _recording )
6060 {
6161 throw new InvalidOperationException ( "Cannot start recording trace while already recording trace." ) ;
6262 }
6363
64- var categories = options . Categories ?? _defaultCategories ;
64+ var categories = options ? . Categories ?? _defaultCategories ;
6565
66- if ( options . Screenshots )
66+ if ( options ? . Screenshots == true )
6767 {
6868 categories . Add ( "disabled-by-default-devtools.screenshot" ) ;
6969 }
7070
71- _path = options . Path ;
71+ _path = options ? . Path ;
7272 _recording = true ;
7373
7474 return _client . SendAsync ( "Tracing.start" , new TracingStartRequest
You can’t perform that action at this time.
0 commit comments