Skip to content

Commit

Permalink
[dotnet] Update supported version of CDP to 94, remove 92
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Sep 28, 2021
1 parent 71f6be9 commit c1719be
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 64 deletions.
2 changes: 1 addition & 1 deletion dotnet/selenium-dotnet-version.bzl
Expand Up @@ -7,8 +7,8 @@ SUPPORTED_NET_STANDARD_VERSIONS = ["netstandard2.0", "netstandard2.1", "net5.0"]

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

ASSEMBLY_COMPANY = "Selenium Committers"
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/DevTools/DevToolsDomains.cs
Expand Up @@ -37,9 +37,9 @@ public abstract class DevToolsDomains
// added to this dictionary.
private static readonly Dictionary<int, Type> SupportedDevToolsVersions = new Dictionary<int, Type>()
{
{ 94, typeof(V94.V94Domains) },
{ 93, typeof(V93.V93Domains) },
{ 92, typeof(V92.V92Domains) },
{ 85, typeof(V85.V85Domains) }
{ 85, typeof(V85.V85Domains) }
};

/// <summary>
Expand Down
@@ -1,4 +1,4 @@
// <copyright file="V92Domains.cs" company="WebDriver Committers">
// <copyright file="v94Domains.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,24 +19,24 @@
using System.Collections.Generic;
using System.Text;

namespace OpenQA.Selenium.DevTools.V92
namespace OpenQA.Selenium.DevTools.v94
{
/// <summary>
/// Class containing the domain implementation for version 88 of the DevTools Protocol.
/// Class containing the domain implementation for version 90 of the DevTools Protocol.
/// </summary>
public class V92Domains : DevToolsDomains
public class v94Domains : DevToolsDomains
{
private DevToolsSessionDomains domains;

public V92Domains(DevToolsSession session)
public v94Domains(DevToolsSession session)
{
this.domains = new DevToolsSessionDomains(session);
}

/// <summary>
/// Gets the DevTools Protocol version for which this class is valid.
/// </summary>
public static int DevToolsVersion => 92;
public static int DevToolsVersion => 94;

/// <summary>
/// Gets the version-specific domains for the DevTools session. This value must be cast to a version specific type to be at all useful.
Expand All @@ -46,21 +46,21 @@ public V92Domains(DevToolsSession session)
/// <summary>
/// Gets the object used for manipulating network information in the browser.
/// </summary>
public override DevTools.Network Network => new V92Network(domains.Network, domains.Fetch);
public override DevTools.Network Network => new v94Network(domains.Network, domains.Fetch);

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

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

/// <summary>
/// Gets the object used for manipulating the browser's logs.
/// </summary>
public override DevTools.Log Log => new V92Log(domains.Log);
public override DevTools.Log Log => new v94Log(domains.Log);
}
}
@@ -1,4 +1,4 @@
// <copyright file="V92JavaScript.cs" company="WebDriver Committers">
// <copyright file="v94JavaScript.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.V92.Page;
using OpenQA.Selenium.DevTools.V92.Runtime;
using OpenQA.Selenium.DevTools.v94.Page;
using OpenQA.Selenium.DevTools.v94.Runtime;

namespace OpenQA.Selenium.DevTools.V92
namespace OpenQA.Selenium.DevTools.v94
{
/// <summary>
/// Class containing the JavaScript implementation for version 88 of the DevTools Protocol.
/// Class containing the JavaScript implementation for version 89 of the DevTools Protocol.
/// </summary>
public class V92JavaScript : JavaScript
public class v94JavaScript : JavaScript
{
private RuntimeAdapter runtime;
private PageAdapter page;

/// <summary>
/// Initializes a new instance of the <see cref="V92JavaScript"/> class.
/// Initializes a new instance of the <see cref="v94JavaScript"/> 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 V92JavaScript(RuntimeAdapter runtime, PageAdapter page)
public v94JavaScript(RuntimeAdapter runtime, PageAdapter page)
{
this.runtime = runtime;
this.page = page;
Expand Down
@@ -1,4 +1,4 @@
// <copyright file="V92Log.cs" company="WebDriver Committers">
// <copyright file="v94Log.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.V92.Log;
using OpenQA.Selenium.DevTools.v94.Log;

namespace OpenQA.Selenium.DevTools.V92
namespace OpenQA.Selenium.DevTools.v94
{
/// <summary>
/// Class containing the browser's log as referenced by version 88 of the DevTools Protocol.
/// Class containing the browser's log as referenced by version 89 of the DevTools Protocol.
/// </summary>
public class V92Log : DevTools.Log
public class v94Log : DevTools.Log
{
private LogAdapter adapter;

/// <summary>
/// Initializes a new instance of the <see cref="V92Log"/> class.
/// Initializes a new instance of the <see cref="v94Log"/> class.
/// </summary>
/// <param name="adapter">The adapter for the Log domain.</param>
public V92Log(LogAdapter adapter)
public v94Log(LogAdapter adapter)
{
this.adapter = adapter;
this.adapter.EntryAdded += OnAdapterEntryAdded;
Expand Down
@@ -1,4 +1,4 @@
// <copyright file="V92Network.cs" company="WebDriver Committers">
// <copyright file="v94Network.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,31 +20,30 @@
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium.DevTools.V92.Fetch;
using OpenQA.Selenium.DevTools.V92.Network;
using OpenQA.Selenium.DevTools.v94.Fetch;
using OpenQA.Selenium.DevTools.v94.Network;

namespace OpenQA.Selenium.DevTools.V92
namespace OpenQA.Selenium.DevTools.v94
{
/// <summary>
/// Class providing functionality for manipulating network calls using version 88 of the DevTools Protocol
/// Class providing functionality for manipulating network calls using version 89 of the DevTools Protocol
/// </summary>
public class V92Network : DevTools.Network
public class v94Network : DevTools.Network
{
private FetchAdapter fetch;
private NetworkAdapter network;

/// <summary>
/// Initializes a new instance of the <see cref="V92Network"/> class.
/// Initializes a new instance of the <see cref="v94Network"/> class.
/// </summary>
/// <param name="network">The adapter for the Network domain.</param>
/// <param name="fetch">The adapter for the Fetch domain.</param>
public V92Network(NetworkAdapter network, FetchAdapter fetch)
public v94Network(NetworkAdapter network, FetchAdapter fetch)
{
this.network = network;
this.fetch = fetch;
fetch.AuthRequired += OnFetchAuthRequired;
fetch.RequestPaused += OnFetchRequestPaused;

}

/// <summary>
Expand Down Expand Up @@ -81,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.V92.Fetch.EnableCommandSettings()
await fetch.Enable(new OpenQA.Selenium.DevTools.v94.Fetch.EnableCommandSettings()
{
Patterns = new OpenQA.Selenium.DevTools.V92.Fetch.RequestPattern[]
Patterns = new OpenQA.Selenium.DevTools.v94.Fetch.RequestPattern[]
{
new OpenQA.Selenium.DevTools.V92.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Request },
new OpenQA.Selenium.DevTools.V92.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Response }
new OpenQA.Selenium.DevTools.v94.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Request },
new OpenQA.Selenium.DevTools.v94.Fetch.RequestPattern() { UrlPattern = "*", RequestStage = RequestStage.Response }
},
HandleAuthRequests = true
});
Expand Down Expand Up @@ -194,9 +193,9 @@ public override async Task ContinueWithAuth(string requestId, string userName, s
await fetch.ContinueWithAuth(new ContinueWithAuthCommandSettings()
{
RequestId = requestId,
AuthChallengeResponse = new V92.Fetch.AuthChallengeResponse()
AuthChallengeResponse = new v94.Fetch.AuthChallengeResponse()
{
Response = V92.Fetch.AuthChallengeResponseResponseValues.ProvideCredentials,
Response = v94.Fetch.AuthChallengeResponseResponseValues.ProvideCredentials,
Username = userName,
Password = password
}
Expand All @@ -213,9 +212,9 @@ public override async Task CancelAuth(string requestId)
await fetch.ContinueWithAuth(new ContinueWithAuthCommandSettings()
{
RequestId = requestId,
AuthChallengeResponse = new OpenQA.Selenium.DevTools.V92.Fetch.AuthChallengeResponse()
AuthChallengeResponse = new OpenQA.Selenium.DevTools.v94.Fetch.AuthChallengeResponse()
{
Response = V92.Fetch.AuthChallengeResponseResponseValues.CancelAuth
Response = v94.Fetch.AuthChallengeResponseResponseValues.CancelAuth
}
});
}
Expand Down
@@ -1,4 +1,4 @@
// <copyright file="V92Target.cs" company="WebDriver Committers">
// <copyright file="v94Target.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.V92.Target;
using OpenQA.Selenium.DevTools.v94.Target;

namespace OpenQA.Selenium.DevTools.V92
namespace OpenQA.Selenium.DevTools.v94
{
/// <summary>
/// Class providing functionality for manipulating targets for version 88 of the DevTools Protocol
/// Class providing functionality for manipulating targets for version 89 of the DevTools Protocol
/// </summary>
public class V92Target : DevTools.Target
public class v94Target : DevTools.Target
{
private TargetAdapter adapter;

/// <summary>
/// Initializes a new instance of the <see cref="V92Target"/> class.
/// Initializes a new instance of the <see cref="v94Target"/> class.
/// </summary>
/// <param name="adapter">The adapter for the Target domain.</param>
public V92Target(TargetAdapter adapter)
public v94Target(TargetAdapter adapter)
{
this.adapter = adapter;
}
Expand Down
12 changes: 6 additions & 6 deletions dotnet/src/webdriver/WebDriver.csproj.prebuild.cmd
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\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
)

if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v93\DevToolsSessionDomains.cs" (
echo Generating CDP code for version 93
if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v94\DevToolsSessionDomains.cs" (
echo Generating CDP code for version 94
pushd "%1..\..\.."
bazel build //dotnet/src/webdriver/cdp:generate-v93
bazel build //dotnet/src/webdriver/cdp:generate-v94
popd
)
12 changes: 6 additions & 6 deletions dotnet/src/webdriver/WebDriver.csproj.prebuild.sh
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/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

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

0 comments on commit c1719be

Please sign in to comment.