File tree 6 files changed +18
-12
lines changed 6 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public abstract class Target
40
40
/// contains the list of <see cref="TargetInfo"/> objects describing the
41
41
/// targets available for this session.
42
42
/// </returns>
43
- public abstract Task < ReadOnlyCollection < TargetInfo > > GetTargets ( ) ;
43
+ public abstract Task < ReadOnlyCollection < TargetInfo > > GetTargets ( Object settings = null ) ;
44
44
45
45
/// <summary>
46
46
/// Asynchronously attaches to a target.
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ public V105Target(TargetAdapter adapter)
50
50
/// contains the list of <see cref="TargetInfo"/> objects describing the
51
51
/// targets available for this session.
52
52
/// </returns>
53
- public override async Task < ReadOnlyCollection < TargetInfo > > GetTargets ( )
53
+ public override async Task < ReadOnlyCollection < TargetInfo > > GetTargets ( Object settings = null )
54
54
{
55
55
List < TargetInfo > targets = new List < TargetInfo > ( ) ;
56
56
var response = await adapter . GetTargets ( ) ;
Original file line number Diff line number Diff line change @@ -50,11 +50,15 @@ public V106Target(TargetAdapter adapter)
50
50
/// contains the list of <see cref="TargetInfo"/> objects describing the
51
51
/// targets available for this session.
52
52
/// </returns>
53
- public override async Task < ReadOnlyCollection < TargetInfo > > GetTargets ( )
53
+ public override async Task < ReadOnlyCollection < TargetInfo > > GetTargets ( Object settings = null )
54
54
55
55
{
56
56
List < TargetInfo > targets = new List < TargetInfo > ( ) ;
57
- var response = await adapter . GetTargets ( new GetTargetsCommandSettings ( ) ) ;
57
+ if ( settings == null )
58
+ {
59
+ settings = new GetTargetsCommandSettings ( ) ;
60
+ }
61
+ var response = await adapter . GetTargets ( ( GetTargetsCommandSettings ) settings ) ;
58
62
for ( int i = 0 ; i < response . TargetInfos . Length ; i ++ )
59
63
{
60
64
var targetInfo = response . TargetInfos [ i ] ;
Original file line number Diff line number Diff line change @@ -50,11 +50,15 @@ public V107Target(TargetAdapter adapter)
50
50
/// contains the list of <see cref="TargetInfo"/> objects describing the
51
51
/// targets available for this session.
52
52
/// </returns>
53
- public override async Task < ReadOnlyCollection < TargetInfo > > GetTargets ( )
53
+ public override async Task < ReadOnlyCollection < TargetInfo > > GetTargets ( Object settings = null )
54
54
55
55
{
56
56
List < TargetInfo > targets = new List < TargetInfo > ( ) ;
57
- var response = await adapter . GetTargets ( new GetTargetsCommandSettings ( ) ) ;
57
+ if ( settings == null )
58
+ {
59
+ settings = new GetTargetsCommandSettings ( ) ;
60
+ }
61
+ var response = await adapter . GetTargets ( ( GetTargetsCommandSettings ) settings ) ;
58
62
for ( int i = 0 ; i < response . TargetInfos . Length ; i ++ )
59
63
{
60
64
var targetInfo = response . TargetInfos [ i ] ;
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ public V85Target(TargetAdapter adapter)
50
50
/// contains the list of <see cref="TargetInfo"/> objects describing the
51
51
/// targets available for this session.
52
52
/// </returns>
53
- public override async Task < ReadOnlyCollection < TargetInfo > > GetTargets ( )
53
+ public override async Task < ReadOnlyCollection < TargetInfo > > GetTargets ( Object settings = null )
54
54
{
55
55
List < TargetInfo > targets = new List < TargetInfo > ( ) ;
56
56
var response = await adapter . GetTargets ( ) ;
Original file line number Diff line number Diff line change 1
1
using System ;
2
- using System . Collections . Generic ;
3
- using System . Linq ;
4
- using System . Text ;
5
2
using System . Threading ;
6
3
using System . Threading . Tasks ;
7
4
using NUnit . Framework ;
5
+ using OpenQA . Selenium . DevTools . V107 . Target ;
8
6
using OpenQA . Selenium . Environment ;
9
7
10
8
namespace OpenQA . Selenium . DevTools
@@ -22,7 +20,7 @@ public async Task GetTargetActivateAndAttach()
22
20
{
23
21
var domains = session . GetVersionSpecificDomains < V107 . DevToolsSessionDomains > ( ) ;
24
22
driver . Url = EnvironmentManager . Instance . UrlBuilder . WhereIs ( "devToolsConsoleTest.html" ) ;
25
- var response = await domains . Target . GetTargets ( ) ;
23
+ var response = await domains . Target . GetTargets ( new GetTargetsCommandSettings ( ) ) ;
26
24
V107 . Target . TargetInfo [ ] allTargets = response . TargetInfos ;
27
25
foreach ( V107 . Target . TargetInfo targetInfo in allTargets )
28
26
{
@@ -62,7 +60,7 @@ public async Task GetTargetAndSendMessageToTarget()
62
60
ValidateMessage ( e ) ;
63
61
sync . Set ( ) ;
64
62
} ;
65
- var targetsResponse = await domains . Target . GetTargets ( ) ;
63
+ var targetsResponse = await domains . Target . GetTargets ( new GetTargetsCommandSettings ( ) ) ;
66
64
allTargets = targetsResponse . TargetInfos ;
67
65
ValidateTargetsInfos ( allTargets ) ;
68
66
ValidateTarget ( allTargets [ 0 ] ) ;
You can’t perform that action at this time.
0 commit comments