Skip to content

Commit

Permalink
[dotnet] Update supported version of CDP to 93, remove 91
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Sep 1, 2021
1 parent 618e8aa commit d6bb232
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 57 deletions.
2 changes: 1 addition & 1 deletion dotnet/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
v4.0.0rc1
=========
* Set available versions of Chrome DevTools Protocol to 85, 91, and 92.
* Set available versions of Chrome DevTools Protocol to 85, 92, and 93.
* Enabled script pinning. This allows the user to add a snippet of JavaScript
to a page that will be available on all subsquent pages, and not have to
pass the script across the wire every time. For exceptionally large blobs
Expand Down
2 changes: 1 addition & 1 deletion dotnet/selenium-dotnet-version.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ SUPPORTED_NET_STANDARD_VERSIONS = ["netstandard2.0", "netstandard2.1", "net5.0"]

SUPPORTED_DEVTOOLS_VERSIONS = [
"v85",
"v91",
"v92",
"v93",
]

ASSEMBLY_COMPANY = "Selenium Committers"
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/DevTools/DevToolsDomains.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public abstract class DevToolsDomains
// added to this dictionary.
private static readonly Dictionary<int, Type> SupportedDevToolsVersions = new Dictionary<int, Type>()
{
{ 93, typeof(V93.V93Domains) },
{ 92, typeof(V92.V92Domains) },
{ 91, typeof(V91.V91Domains) },
{ 85, typeof(V85.V85Domains) }
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="V91Domains.cs" company="WebDriver Committers">
// <copyright file="V93Domains.cs" company="WebDriver Committers">
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
Expand All @@ -19,16 +19,16 @@
using System.Collections.Generic;
using System.Text;

namespace OpenQA.Selenium.DevTools.V91
namespace OpenQA.Selenium.DevTools.V93
{
/// <summary>
/// Class containing the domain implementation for version 90 of the DevTools Protocol.
/// </summary>
public class V91Domains : DevToolsDomains
public class V93Domains : DevToolsDomains
{
private DevToolsSessionDomains domains;

public V91Domains(DevToolsSession session)
public V93Domains(DevToolsSession session)
{
this.domains = new DevToolsSessionDomains(session);
}
Expand All @@ -46,21 +46,21 @@ public V91Domains(DevToolsSession session)
/// <summary>
/// Gets the object used for manipulating network information in the browser.
/// </summary>
public override DevTools.Network Network => new V91Network(domains.Network, domains.Fetch);
public override DevTools.Network Network => new V93Network(domains.Network, domains.Fetch);

/// <summary>
/// Gets the object used for manipulating the browser's JavaScript execution.
/// </summary>
public override JavaScript JavaScript => new V91JavaScript(domains.Runtime, domains.Page);
public override JavaScript JavaScript => new V93JavaScript(domains.Runtime, domains.Page);

/// <summary>
/// Gets the object used for manipulating DevTools Protocol targets.
/// </summary>
public override DevTools.Target Target => new V91Target(domains.Target);
public override DevTools.Target Target => new V93Target(domains.Target);

/// <summary>
/// Gets the object used for manipulating the browser's logs.
/// </summary>
public override DevTools.Log Log => new V91Log(domains.Log);
public override DevTools.Log Log => new V93Log(domains.Log);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="V91JavaScript.cs" company="WebDriver Committers">
// <copyright file="V93JavaScript.cs" company="WebDriver Committers">
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
Expand All @@ -18,25 +18,25 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using OpenQA.Selenium.DevTools.V91.Page;
using OpenQA.Selenium.DevTools.V91.Runtime;
using OpenQA.Selenium.DevTools.V93.Page;
using OpenQA.Selenium.DevTools.V93.Runtime;

namespace OpenQA.Selenium.DevTools.V91
namespace OpenQA.Selenium.DevTools.V93
{
/// <summary>
/// Class containing the JavaScript implementation for version 89 of the DevTools Protocol.
/// </summary>
public class V91JavaScript : JavaScript
public class V93JavaScript : JavaScript
{
private RuntimeAdapter runtime;
private PageAdapter page;

/// <summary>
/// Initializes a new instance of the <see cref="V91JavaScript"/> class.
/// Initializes a new instance of the <see cref="V93JavaScript"/> class.
/// </summary>
/// <param name="runtime">The DevTools Protocol adapter for the Runtime domain.</param>
/// <param name="page">The DevTools Protocol adapter for the Page domain.</param>
public V91JavaScript(RuntimeAdapter runtime, PageAdapter page)
public V93JavaScript(RuntimeAdapter runtime, PageAdapter page)
{
this.runtime = runtime;
this.page = page;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="V91Log.cs" company="WebDriver Committers">
// <copyright file="V93Log.cs" company="WebDriver Committers">
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
Expand All @@ -20,22 +20,22 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using OpenQA.Selenium.DevTools.V91.Log;
using OpenQA.Selenium.DevTools.V93.Log;

namespace OpenQA.Selenium.DevTools.V91
namespace OpenQA.Selenium.DevTools.V93
{
/// <summary>
/// Class containing the browser's log as referenced by version 89 of the DevTools Protocol.
/// </summary>
public class V91Log : DevTools.Log
public class V93Log : DevTools.Log
{
private LogAdapter adapter;

/// <summary>
/// Initializes a new instance of the <see cref="V91Log"/> class.
/// Initializes a new instance of the <see cref="V93Log"/> class.
/// </summary>
/// <param name="adapter">The adapter for the Log domain.</param>
public V91Log(LogAdapter adapter)
public V93Log(LogAdapter adapter)
{
this.adapter = adapter;
this.adapter.EntryAdded += OnAdapterEntryAdded;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="V91Network.cs" company="WebDriver Committers">
// <copyright file="V93Network.cs" company="WebDriver Committers">
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
Expand All @@ -20,25 +20,25 @@
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium.DevTools.V91.Fetch;
using OpenQA.Selenium.DevTools.V91.Network;
using OpenQA.Selenium.DevTools.V93.Fetch;
using OpenQA.Selenium.DevTools.V93.Network;

namespace OpenQA.Selenium.DevTools.V91
namespace OpenQA.Selenium.DevTools.V93
{
/// <summary>
/// Class providing functionality for manipulating network calls using version 89 of the DevTools Protocol
/// </summary>
public class V91Network : DevTools.Network
public class V93Network : DevTools.Network
{
private FetchAdapter fetch;
private NetworkAdapter network;

/// <summary>
/// Initializes a new instance of the <see cref="V91Network"/> class.
/// Initializes a new instance of the <see cref="V93Network"/> class.
/// </summary>
/// <param name="network">The adapter for the Network domain.</param>
/// <param name="fetch">The adapter for the Fetch domain.</param>
public V91Network(NetworkAdapter network, FetchAdapter fetch)
public V93Network(NetworkAdapter network, FetchAdapter fetch)
{
this.network = network;
this.fetch = fetch;
Expand Down Expand Up @@ -80,12 +80,12 @@ public override async Task DisableNetwork()
/// <returns>A task that represents the asynchronous operation.</returns>
public override async Task EnableFetchForAllPatterns()
{
await fetch.Enable(new OpenQA.Selenium.DevTools.V91.Fetch.EnableCommandSettings()
await fetch.Enable(new OpenQA.Selenium.DevTools.V93.Fetch.EnableCommandSettings()
{
Patterns = new OpenQA.Selenium.DevTools.V91.Fetch.RequestPattern[]
Patterns = new OpenQA.Selenium.DevTools.V93.Fetch.RequestPattern[]
{
new OpenQA.Selenium.DevTools.V91.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Request },
new OpenQA.Selenium.DevTools.V91.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Response }
new OpenQA.Selenium.DevTools.V93.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Request },
new OpenQA.Selenium.DevTools.V93.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Response }
},
HandleAuthRequests = true
});
Expand Down Expand Up @@ -193,9 +193,9 @@ public override async Task ContinueWithAuth(string requestId, string userName, s
await fetch.ContinueWithAuth(new ContinueWithAuthCommandSettings()
{
RequestId = requestId,
AuthChallengeResponse = new V91.Fetch.AuthChallengeResponse()
AuthChallengeResponse = new V93.Fetch.AuthChallengeResponse()
{
Response = V91.Fetch.AuthChallengeResponseResponseValues.ProvideCredentials,
Response = V93.Fetch.AuthChallengeResponseResponseValues.ProvideCredentials,
Username = userName,
Password = password
}
Expand All @@ -212,9 +212,9 @@ public override async Task CancelAuth(string requestId)
await fetch.ContinueWithAuth(new ContinueWithAuthCommandSettings()
{
RequestId = requestId,
AuthChallengeResponse = new OpenQA.Selenium.DevTools.V91.Fetch.AuthChallengeResponse()
AuthChallengeResponse = new OpenQA.Selenium.DevTools.V93.Fetch.AuthChallengeResponse()
{
Response = V91.Fetch.AuthChallengeResponseResponseValues.CancelAuth
Response = V93.Fetch.AuthChallengeResponseResponseValues.CancelAuth
}
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="V91Target.cs" company="WebDriver Committers">
// <copyright file="V93Target.cs" company="WebDriver Committers">
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
Expand All @@ -21,22 +21,22 @@
using System.Collections.ObjectModel;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium.DevTools.V91.Target;
using OpenQA.Selenium.DevTools.V93.Target;

namespace OpenQA.Selenium.DevTools.V91
namespace OpenQA.Selenium.DevTools.V93
{
/// <summary>
/// Class providing functionality for manipulating targets for version 89 of the DevTools Protocol
/// </summary>
public class V91Target : DevTools.Target
public class V93Target : DevTools.Target
{
private TargetAdapter adapter;

/// <summary>
/// Initializes a new instance of the <see cref="V91Target"/> class.
/// Initializes a new instance of the <see cref="V93Target"/> class.
/// </summary>
/// <param name="adapter">The adapter for the Target domain.</param>
public V91Target(TargetAdapter adapter)
public V93Target(TargetAdapter adapter)
{
this.adapter = adapter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ protected virtual void Dispose(bool disposing)
{
if (disposing)
{
this.internalExecutor.Dispose();
this.service.Dispose();
}

Expand Down
2 changes: 2 additions & 0 deletions dotnet/src/webdriver/WebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,8 @@ protected virtual void Dispose(bool disposing)
{
this.sessionId = null;
}

this.executor.Dispose();
}

private static void UnpackAndThrowOnError(Response errorResponse)
Expand Down
12 changes: 6 additions & 6 deletions dotnet/src/webdriver/WebDriver.csproj.prebuild.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v85\DevToolsSession
popd
)

if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v91\DevToolsSessionDomains.cs" (
echo Generating CDP code for version 91
if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v92\DevToolsSessionDomains.cs" (
echo Generating CDP code for version 92
pushd "%1..\..\.."
bazel build //dotnet/src/webdriver/cdp:generate-v91
bazel build //dotnet/src/webdriver/cdp:generate-v92
popd
)

if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v92\DevToolsSessionDomains.cs" (
echo Generating CDP code for version 92
if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v93\DevToolsSessionDomains.cs" (
echo Generating CDP code for version 93
pushd "%1..\..\.."
bazel build //dotnet/src/webdriver/cdp:generate-v92
bazel build //dotnet/src/webdriver/cdp:generate-v93
popd
)
12 changes: 6 additions & 6 deletions dotnet/src/webdriver/WebDriver.csproj.prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ then
bazel build //dotnet/src/webdriver/cdp:generate-v85
fi

if [[ ! -f "$1../../../bazel-bin/dotnet/src/webdriver/cdp/v91/DevToolsSessionDomains.cs" ]]
then
echo "Generating CDP code for version 91"
bazel build //dotnet/src/webdriver/cdp:generate-v91
fi

if [[ ! -f "$1../../../bazel-bin/dotnet/src/webdriver/cdp/v92/DevToolsSessionDomains.cs" ]]
then
echo "Generating CDP code for version 92"
bazel build //dotnet/src/webdriver/cdp:generate-v92
fi

if [[ ! -f "$1../../../bazel-bin/dotnet/src/webdriver/cdp/v93/DevToolsSessionDomains.cs" ]]
then
echo "Generating CDP code for version 93"
bazel build //dotnet/src/webdriver/cdp:generate-v93
fi

0 comments on commit d6bb232

Please sign in to comment.