Skip to content

Commit 285dace

Browse files
committed
[dotnet][cdp] add support for Chrome 108 and remove support for Chrome 105
1 parent 922f5d3 commit 285dace

16 files changed

+201
-198
lines changed

dotnet/selenium-dotnet-version.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ SUPPORTED_NET_STANDARD_VERSIONS = ["netstandard2.0", "netstandard2.1", "net5.0",
77

88
SUPPORTED_DEVTOOLS_VERSIONS = [
99
"v85",
10-
"v105",
1110
"v106",
1211
"v107",
12+
"v108",
1313
]
1414

1515
ASSEMBLY_COMPANY = "Selenium Committers"

dotnet/src/webdriver/DevTools/DevToolsDomains.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public abstract class DevToolsDomains
3737
// added to this dictionary.
3838
private static readonly Dictionary<int, Type> SupportedDevToolsVersions = new Dictionary<int, Type>()
3939
{
40+
{ 108, typeof(V108.V108Domains) },
4041
{ 107, typeof(V107.V107Domains) },
4142
{ 106, typeof(V106.V106Domains) },
42-
{ 105, typeof(V105.V105Domains) },
4343
{ 85, typeof(V85.V85Domains) }
4444
};
4545

dotnet/src/webdriver/DevTools/v105/V105Domains.cs renamed to dotnet/src/webdriver/DevTools/v108/V108Domains.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="V105Domains.cs" company="WebDriver Committers">
1+
// <copyright file="V108Domains.cs" company="WebDriver Committers">
22
// Licensed to the Software Freedom Conservancy (SFC) under one
33
// or more contributor license agreements. See the NOTICE file
44
// distributed with this work for additional information
@@ -19,24 +19,24 @@
1919
using System.Collections.Generic;
2020
using System.Text;
2121

22-
namespace OpenQA.Selenium.DevTools.V105
22+
namespace OpenQA.Selenium.DevTools.V108
2323
{
2424
/// <summary>
25-
/// Class containing the domain implementation for version 105 of the DevTools Protocol.
25+
/// Class containing the domain implementation for version 108 of the DevTools Protocol.
2626
/// </summary>
27-
public class V105Domains : DevToolsDomains
27+
public class V108Domains : DevToolsDomains
2828
{
2929
private DevToolsSessionDomains domains;
3030

31-
public V105Domains(DevToolsSession session)
31+
public V108Domains(DevToolsSession session)
3232
{
3333
this.domains = new DevToolsSessionDomains(session);
3434
}
3535

3636
/// <summary>
3737
/// Gets the DevTools Protocol version for which this class is valid.
3838
/// </summary>
39-
public static int DevToolsVersion => 105;
39+
public static int DevToolsVersion => 108;
4040

4141
/// <summary>
4242
/// Gets the version-specific domains for the DevTools session. This value must be cast to a version specific type to be at all useful.
@@ -46,21 +46,21 @@ public V105Domains(DevToolsSession session)
4646
/// <summary>
4747
/// Gets the object used for manipulating network information in the browser.
4848
/// </summary>
49-
public override DevTools.Network Network => new V105Network(domains.Network, domains.Fetch);
49+
public override DevTools.Network Network => new V108Network(domains.Network, domains.Fetch);
5050

5151
/// <summary>
5252
/// Gets the object used for manipulating the browser's JavaScript execution.
5353
/// </summary>
54-
public override JavaScript JavaScript => new V105JavaScript(domains.Runtime, domains.Page);
54+
public override JavaScript JavaScript => new V108JavaScript(domains.Runtime, domains.Page);
5555

5656
/// <summary>
5757
/// Gets the object used for manipulating DevTools Protocol targets.
5858
/// </summary>
59-
public override DevTools.Target Target => new V105Target(domains.Target);
59+
public override DevTools.Target Target => new V108Target(domains.Target);
6060

6161
/// <summary>
6262
/// Gets the object used for manipulating the browser's logs.
6363
/// </summary>
64-
public override DevTools.Log Log => new V105Log(domains.Log);
64+
public override DevTools.Log Log => new V108Log(domains.Log);
6565
}
6666
}

dotnet/src/webdriver/DevTools/v105/V105JavaScript.cs renamed to dotnet/src/webdriver/DevTools/v108/V108JavaScript.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="V105JavaScript.cs" company="WebDriver Committers">
1+
// <copyright file="V108JavaScript.cs" company="WebDriver Committers">
22
// Licensed to the Software Freedom Conservancy (SFC) under one
33
// or more contributor license agreements. See the NOTICE file
44
// distributed with this work for additional information
@@ -18,25 +18,25 @@
1818
using System;
1919
using System.Collections.Generic;
2020
using System.Threading.Tasks;
21-
using OpenQA.Selenium.DevTools.V105.Page;
22-
using OpenQA.Selenium.DevTools.V105.Runtime;
21+
using OpenQA.Selenium.DevTools.V108.Page;
22+
using OpenQA.Selenium.DevTools.V108.Runtime;
2323

24-
namespace OpenQA.Selenium.DevTools.V105
24+
namespace OpenQA.Selenium.DevTools.V108
2525
{
2626
/// <summary>
27-
/// Class containing the JavaScript implementation for version 105 of the DevTools Protocol.
27+
/// Class containing the JavaScript implementation for version 108 of the DevTools Protocol.
2828
/// </summary>
29-
public class V105JavaScript : JavaScript
29+
public class V108JavaScript : JavaScript
3030
{
3131
private RuntimeAdapter runtime;
3232
private PageAdapter page;
3333

3434
/// <summary>
35-
/// Initializes a new instance of the <see cref="V105JavaScript"/> class.
35+
/// Initializes a new instance of the <see cref="V108JavaScript"/> class.
3636
/// </summary>
3737
/// <param name="runtime">The DevTools Protocol adapter for the Runtime domain.</param>
3838
/// <param name="page">The DevTools Protocol adapter for the Page domain.</param>
39-
public V105JavaScript(RuntimeAdapter runtime, PageAdapter page)
39+
public V108JavaScript(RuntimeAdapter runtime, PageAdapter page)
4040
{
4141
this.runtime = runtime;
4242
this.page = page;

dotnet/src/webdriver/DevTools/v105/V105Log.cs renamed to dotnet/src/webdriver/DevTools/v108/V108Log.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="V105Log.cs" company="WebDriver Committers">
1+
// <copyright file="V108Log.cs" company="WebDriver Committers">
22
// Licensed to the Software Freedom Conservancy (SFC) under one
33
// or more contributor license agreements. See the NOTICE file
44
// distributed with this work for additional information
@@ -20,22 +20,22 @@
2020
using System.Text;
2121
using System.Threading;
2222
using System.Threading.Tasks;
23-
using OpenQA.Selenium.DevTools.V105.Log;
23+
using OpenQA.Selenium.DevTools.V108.Log;
2424

25-
namespace OpenQA.Selenium.DevTools.V105
25+
namespace OpenQA.Selenium.DevTools.V108
2626
{
2727
/// <summary>
28-
/// Class containing the browser's log as referenced by version 105 of the DevTools Protocol.
28+
/// Class containing the browser's log as referenced by version 108 of the DevTools Protocol.
2929
/// </summary>
30-
public class V105Log : DevTools.Log
30+
public class V108Log : DevTools.Log
3131
{
3232
private LogAdapter adapter;
3333

3434
/// <summary>
35-
/// Initializes a new instance of the <see cref="V105Log"/> class.
35+
/// Initializes a new instance of the <see cref="V108Log"/> class.
3636
/// </summary>
3737
/// <param name="adapter">The adapter for the Log domain.</param>
38-
public V105Log(LogAdapter adapter)
38+
public V108Log(LogAdapter adapter)
3939
{
4040
this.adapter = adapter;
4141
this.adapter.EntryAdded += OnAdapterEntryAdded;

dotnet/src/webdriver/DevTools/v105/V105Network.cs renamed to dotnet/src/webdriver/DevTools/v108/V108Network.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="V105Network.cs" company="WebDriver Committers">
1+
// <copyright file="V108Network.cs" company="WebDriver Committers">
22
// Licensed to the Software Freedom Conservancy (SFC) under one
33
// or more contributor license agreements. See the NOTICE file
44
// distributed with this work for additional information
@@ -20,25 +20,25 @@
2020
using System.Collections.Generic;
2121
using System.Text;
2222
using System.Threading.Tasks;
23-
using OpenQA.Selenium.DevTools.V105.Fetch;
24-
using OpenQA.Selenium.DevTools.V105.Network;
23+
using OpenQA.Selenium.DevTools.V108.Fetch;
24+
using OpenQA.Selenium.DevTools.V108.Network;
2525

26-
namespace OpenQA.Selenium.DevTools.V105
26+
namespace OpenQA.Selenium.DevTools.V108
2727
{
2828
/// <summary>
29-
/// Class providing functionality for manipulating network calls using version 105 of the DevTools Protocol
29+
/// Class providing functionality for manipulating network calls using version 108 of the DevTools Protocol
3030
/// </summary>
31-
public class V105Network : DevTools.Network
31+
public class V108Network : DevTools.Network
3232
{
3333
private FetchAdapter fetch;
3434
private NetworkAdapter network;
3535

3636
/// <summary>
37-
/// Initializes a new instance of the <see cref="V105Network"/> class.
37+
/// Initializes a new instance of the <see cref="V108Network"/> class.
3838
/// </summary>
3939
/// <param name="network">The adapter for the Network domain.</param>
4040
/// <param name="fetch">The adapter for the Fetch domain.</param>
41-
public V105Network(NetworkAdapter network, FetchAdapter fetch)
41+
public V108Network(NetworkAdapter network, FetchAdapter fetch)
4242
{
4343
this.network = network;
4444
this.fetch = fetch;
@@ -80,12 +80,12 @@ public override async Task DisableNetwork()
8080
/// <returns>A task that represents the asynchronous operation.</returns>
8181
public override async Task EnableFetchForAllPatterns()
8282
{
83-
await fetch.Enable(new OpenQA.Selenium.DevTools.V105.Fetch.EnableCommandSettings()
83+
await fetch.Enable(new OpenQA.Selenium.DevTools.V108.Fetch.EnableCommandSettings()
8484
{
85-
Patterns = new OpenQA.Selenium.DevTools.V105.Fetch.RequestPattern[]
85+
Patterns = new OpenQA.Selenium.DevTools.V108.Fetch.RequestPattern[]
8686
{
87-
new OpenQA.Selenium.DevTools.V105.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Request },
88-
new OpenQA.Selenium.DevTools.V105.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Response }
87+
new OpenQA.Selenium.DevTools.V108.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Request },
88+
new OpenQA.Selenium.DevTools.V108.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Response }
8989
},
9090
HandleAuthRequests = true
9191
});
@@ -208,9 +208,9 @@ public override async Task ContinueWithAuth(string requestId, string userName, s
208208
await fetch.ContinueWithAuth(new ContinueWithAuthCommandSettings()
209209
{
210210
RequestId = requestId,
211-
AuthChallengeResponse = new V105.Fetch.AuthChallengeResponse()
211+
AuthChallengeResponse = new V108.Fetch.AuthChallengeResponse()
212212
{
213-
Response = V105.Fetch.AuthChallengeResponseResponseValues.ProvideCredentials,
213+
Response = V108.Fetch.AuthChallengeResponseResponseValues.ProvideCredentials,
214214
Username = userName,
215215
Password = password
216216
}
@@ -227,9 +227,9 @@ public override async Task CancelAuth(string requestId)
227227
await fetch.ContinueWithAuth(new ContinueWithAuthCommandSettings()
228228
{
229229
RequestId = requestId,
230-
AuthChallengeResponse = new OpenQA.Selenium.DevTools.V105.Fetch.AuthChallengeResponse()
230+
AuthChallengeResponse = new OpenQA.Selenium.DevTools.V108.Fetch.AuthChallengeResponse()
231231
{
232-
Response = V105.Fetch.AuthChallengeResponseResponseValues.CancelAuth
232+
Response = V108.Fetch.AuthChallengeResponseResponseValues.CancelAuth
233233
}
234234
});
235235
}

dotnet/src/webdriver/DevTools/v105/V105Target.cs renamed to dotnet/src/webdriver/DevTools/v108/V108Target.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="V105Target.cs" company="WebDriver Committers">
1+
// <copyright file="V108Target.cs" company="WebDriver Committers">
22
// Licensed to the Software Freedom Conservancy (SFC) under one
33
// or more contributor license agreements. See the NOTICE file
44
// distributed with this work for additional information
@@ -21,22 +21,22 @@
2121
using System.Collections.ObjectModel;
2222
using System.Text;
2323
using System.Threading.Tasks;
24-
using OpenQA.Selenium.DevTools.V105.Target;
24+
using OpenQA.Selenium.DevTools.V108.Target;
2525

26-
namespace OpenQA.Selenium.DevTools.V105
26+
namespace OpenQA.Selenium.DevTools.V108
2727
{
2828
/// <summary>
29-
/// Class providing functionality for manipulating targets for version 105 of the DevTools Protocol
29+
/// Class providing functionality for manipulating targets for version 108 of the DevTools Protocol
3030
/// </summary>
31-
public class V105Target : DevTools.Target
31+
public class V108Target : DevTools.Target
3232
{
3333
private TargetAdapter adapter;
3434

3535
/// <summary>
36-
/// Initializes a new instance of the <see cref="V105Target"/> class.
36+
/// Initializes a new instance of the <see cref="V108Target"/> class.
3737
/// </summary>
3838
/// <param name="adapter">The adapter for the Target domain.</param>
39-
public V105Target(TargetAdapter adapter)
39+
public V108Target(TargetAdapter adapter)
4040
{
4141
this.adapter = adapter;
4242
adapter.DetachedFromTarget += OnDetachedFromTarget;
@@ -51,9 +51,14 @@ public V105Target(TargetAdapter adapter)
5151
/// targets available for this session.
5252
/// </returns>
5353
public override async Task<ReadOnlyCollection<TargetInfo>> GetTargets(Object settings = null)
54+
5455
{
5556
List<TargetInfo> targets = new List<TargetInfo>();
56-
var response = await adapter.GetTargets();
57+
if (settings == null)
58+
{
59+
settings = new GetTargetsCommandSettings();
60+
}
61+
var response = await adapter.GetTargets((GetTargetsCommandSettings) settings);
5762
for (int i = 0; i < response.TargetInfos.Length; i++)
5863
{
5964
var targetInfo = response.TargetInfos[i];

dotnet/src/webdriver/WebDriver.csproj.prebuild.cmd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v85\DevToolsSession
2727
popd
2828
)
2929

30-
if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v105\DevToolsSessionDomains.cs" (
31-
echo Generating CDP code for version 105
32-
pushd "%1..\..\.."
33-
bazel build //dotnet/src/webdriver/cdp:generate-v105
34-
popd
35-
)
36-
3730
if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v106\DevToolsSessionDomains.cs" (
3831
echo Generating CDP code for version 106
3932
pushd "%1..\..\.."
@@ -47,3 +40,10 @@ if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v107\DevToolsSessio
4740
bazel build //dotnet/src/webdriver/cdp:generate-v107
4841
popd
4942
)
43+
44+
if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v108\DevToolsSessionDomains.cs" (
45+
echo Generating CDP code for version 108
46+
pushd "%1..\..\.."
47+
bazel build //dotnet/src/webdriver/cdp:generate-v108
48+
popd
49+
)

dotnet/src/webdriver/WebDriver.csproj.prebuild.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ then
2323
bazel build //dotnet/src/webdriver/cdp:generate-v85
2424
fi
2525

26-
if [[ ! -f "$1../../../bazel-bin/dotnet/src/webdriver/cdp/v105/DevToolsSessionDomains.cs" ]]
27-
then
28-
echo "Generating CDP code for version 105"
29-
bazel build //dotnet/src/webdriver/cdp:generate-v105
30-
fi
31-
3226
if [[ ! -f "$1../../../bazel-bin/dotnet/src/webdriver/cdp/v106/DevToolsSessionDomains.cs" ]]
3327
then
3428
echo "Generating CDP code for version 106"
@@ -40,3 +34,9 @@ then
4034
echo "Generating CDP code for version 107"
4135
bazel build //dotnet/src/webdriver/cdp:generate-v107
4236
fi
37+
38+
if [[ ! -f "$1../../../bazel-bin/dotnet/src/webdriver/cdp/v108/DevToolsSessionDomains.cs" ]]
39+
then
40+
echo "Generating CDP code for version 108"
41+
bazel build //dotnet/src/webdriver/cdp:generate-v108
42+
fi

dotnet/test/common/DevTools/DevToolsConsoleTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ public class DevToolsConsoleTest : DevToolsTestFixture
1818
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
1919
public async Task VerifyMessageAdded()
2020
{
21-
var domains = session.GetVersionSpecificDomains<V107.DevToolsSessionDomains>();
21+
var domains = session.GetVersionSpecificDomains<V108.DevToolsSessionDomains>();
2222
string consoleMessage = "Hello Selenium";
2323

2424
ManualResetEventSlim sync = new ManualResetEventSlim(false);
25-
EventHandler<V107.Console.MessageAddedEventArgs> messageAddedHandler = (sender, e) =>
25+
EventHandler<V108.Console.MessageAddedEventArgs> messageAddedHandler = (sender, e) =>
2626
{
2727
Assert.That(e.Message.Text, Is.EqualTo(consoleMessage));
2828
sync.Set();

dotnet/test/common/DevTools/DevToolsLogTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public class DevToolsLogTest : DevToolsTestFixture
1919
[IgnoreBrowser(Selenium.Browser.Safari, "Safari does not support Chrome DevTools Protocol")]
2020
public async Task VerifyEntryAddedAndClearLog()
2121
{
22-
var domains = session.GetVersionSpecificDomains<V107.DevToolsSessionDomains>();
22+
var domains = session.GetVersionSpecificDomains<V108.DevToolsSessionDomains>();
2323
ManualResetEventSlim sync = new ManualResetEventSlim(false);
24-
EventHandler<V107.Log.EntryAddedEventArgs> entryAddedHandler = (sender, e) =>
24+
EventHandler<V108.Log.EntryAddedEventArgs> entryAddedHandler = (sender, e) =>
2525
{
2626
Assert.That(e.Entry.Text.Contains("404"));
27-
Assert.That(e.Entry.Level == V107.Log.LogEntryLevelValues.Error);
27+
Assert.That(e.Entry.Level == V108.Log.LogEntryLevelValues.Error);
2828
sync.Set();
2929
};
3030

0 commit comments

Comments
 (0)