1919
2020using OpenQA . Selenium . BiDi . Communication ;
2121using System ;
22+ using System . Collections . Generic ;
2223using System . Threading . Tasks ;
2324
2425namespace OpenQA . Selenium . BiDi . Script ;
@@ -39,11 +40,11 @@ public async Task<EvaluateResult> EvaluateAsync(string expression, bool awaitPro
3940 return result . AsSuccessResult ( ) . ConvertTo < TResult > ( ) ;
4041 }
4142
42- public async Task < EvaluateResult > CallFunctionAsync ( string functionDeclaration , bool awaitPromise , Target target , CallFunctionOptions ? options = null )
43+ public async Task < CallFunctionResult > CallFunctionAsync ( string functionDeclaration , bool awaitPromise , Target target , CallFunctionOptions ? options = null )
4344 {
4445 var @params = new CallFunctionParameters ( functionDeclaration , awaitPromise , target , options ? . Arguments , options ? . ResultOwnership , options ? . SerializationOptions , options ? . This , options ? . UserActivation ) ;
4546
46- return await Broker . ExecuteCommandAsync ( new CallFunctionCommand ( @params ) , options , JsonContext . CallFunctionCommand , JsonContext . EvaluateResult ) . ConfigureAwait ( false ) ;
47+ return await Broker . ExecuteCommandAsync ( new CallFunctionCommand ( @params ) , options , JsonContext . CallFunctionCommand , JsonContext . CallFunctionResult ) . ConfigureAwait ( false ) ;
4748 }
4849
4950 public async Task < TResult ? > CallFunctionAsync < TResult > ( string functionDeclaration , bool awaitPromise , Target target , CallFunctionOptions ? options = null )
@@ -53,6 +54,13 @@ public async Task<EvaluateResult> CallFunctionAsync(string functionDeclaration,
5354 return result . AsSuccessResult ( ) . ConvertTo < TResult > ( ) ;
5455 }
5556
57+ public async Task < DisownResult > DisownAsync ( IEnumerable < Handle > handles , Target target , DisownOptions ? options = null )
58+ {
59+ var @params = new DisownParameters ( handles , target ) ;
60+
61+ return await Broker . ExecuteCommandAsync ( new DisownCommand ( @params ) , options , JsonContext . DisownCommand , JsonContext . DisownResult ) . ConfigureAwait ( false ) ;
62+ }
63+
5664 public async Task < GetRealmsResult > GetRealmsAsync ( GetRealmsOptions ? options = null )
5765 {
5866 var @params = new GetRealmsParameters ( options ? . Context , options ? . Type ) ;
@@ -69,11 +77,11 @@ public async Task<PreloadScript> AddPreloadScriptAsync(string functionDeclaratio
6977 return result . Script ;
7078 }
7179
72- public async Task < EmptyResult > RemovePreloadScriptAsync ( PreloadScript script , RemovePreloadScriptOptions ? options = null )
80+ public async Task < RemovePreloadScriptResult > RemovePreloadScriptAsync ( PreloadScript script , RemovePreloadScriptOptions ? options = null )
7381 {
7482 var @params = new RemovePreloadScriptParameters ( script ) ;
7583
76- return await Broker . ExecuteCommandAsync ( new RemovePreloadScriptCommand ( @params ) , options , JsonContext . RemovePreloadScriptCommand , JsonContext . EmptyResult ) . ConfigureAwait ( false ) ;
84+ return await Broker . ExecuteCommandAsync ( new RemovePreloadScriptCommand ( @params ) , options , JsonContext . RemovePreloadScriptCommand , JsonContext . RemovePreloadScriptResult ) . ConfigureAwait ( false ) ;
7785 }
7886
7987 public async Task < Subscription > OnMessageAsync ( Func < MessageEventArgs , Task > handler , SubscriptionOptions ? options = null )
0 commit comments