Skip to content

Commit

Permalink
[cdp][dotnet] add Chrome 118 and remove 115
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Oct 9, 2023
1 parent c04855f commit c595b7a
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion dotnet/selenium-dotnet-version.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ SUPPORTED_NET_STANDARD_VERSIONS = ["netstandard2.0"]

SUPPORTED_DEVTOOLS_VERSIONS = [
"v85",
"v115",
"v116",
"v117",
"v118",
]

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,9 +37,9 @@ public abstract class DevToolsDomains
// added to this dictionary.
private static readonly Dictionary<int, Type> SupportedDevToolsVersions = new Dictionary<int, Type>()
{
{ 118, typeof(V118.V118Domains) },
{ 117, typeof(V117.V117Domains) },
{ 116, typeof(V116.V116Domains) },
{ 115, typeof(V115.V115Domains) },
{ 85, typeof(V85.V85Domains) }
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="V115Domains.cs" company="WebDriver Committers">
// <copyright file="V118Domains.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,28 +19,28 @@
using System.Collections.Generic;
using System.Text;

namespace OpenQA.Selenium.DevTools.V115
namespace OpenQA.Selenium.DevTools.V118
{
/// <summary>
/// Class containing the domain implementation for version 115 of the DevTools Protocol.
/// Class containing the domain implementation for version 118 of the DevTools Protocol.
/// </summary>
public class V115Domains : DevToolsDomains
public class V118Domains : DevToolsDomains
{
private DevToolsSessionDomains domains;

/// <summary>
/// Initializes a new instance of the V115Domains class.
/// </summary>
/// <param name="session">The DevToolsSession to use with this set of domains.</param>
public V115Domains(DevToolsSession session)
public V118Domains(DevToolsSession session)
{
this.domains = new DevToolsSessionDomains(session);
}

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

/// <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 @@ -50,21 +50,21 @@ public V115Domains(DevToolsSession session)
/// <summary>
/// Gets the object used for manipulating network information in the browser.
/// </summary>
public override DevTools.Network Network => new V115Network(domains.Network, domains.Fetch);
public override DevTools.Network Network => new V118Network(domains.Network, domains.Fetch);

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

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

/// <summary>
/// Gets the object used for manipulating the browser's logs.
/// </summary>
public override DevTools.Log Log => new V115Log(domains.Log);
public override DevTools.Log Log => new V118Log(domains.Log);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="V115JavaScript.cs" company="WebDriver Committers">
// <copyright file="V118JavaScript.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.V115.Page;
using OpenQA.Selenium.DevTools.V115.Runtime;
using OpenQA.Selenium.DevTools.V118.Page;
using OpenQA.Selenium.DevTools.V118.Runtime;

namespace OpenQA.Selenium.DevTools.V115
namespace OpenQA.Selenium.DevTools.V118
{
/// <summary>
/// Class containing the JavaScript implementation for version 115 of the DevTools Protocol.
/// Class containing the JavaScript implementation for version 118 of the DevTools Protocol.
/// </summary>
public class V115JavaScript : JavaScript
public class V118JavaScript : JavaScript
{
private RuntimeAdapter runtime;
private PageAdapter page;

/// <summary>
/// Initializes a new instance of the <see cref="V115JavaScript"/> class.
/// Initializes a new instance of the <see cref="V118JavaScript"/> 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 V115JavaScript(RuntimeAdapter runtime, PageAdapter page)
public V118JavaScript(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="V115Log.cs" company="WebDriver Committers">
// <copyright file="V118Log.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.V115.Log;
using OpenQA.Selenium.DevTools.V118.Log;

namespace OpenQA.Selenium.DevTools.V115
namespace OpenQA.Selenium.DevTools.V118
{
/// <summary>
/// Class containing the browser's log as referenced by version 115 of the DevTools Protocol.
/// Class containing the browser's log as referenced by version 118 of the DevTools Protocol.
/// </summary>
public class V115Log : DevTools.Log
public class V118Log : DevTools.Log
{
private LogAdapter adapter;

/// <summary>
/// Initializes a new instance of the <see cref="V115Log"/> class.
/// Initializes a new instance of the <see cref="V118Log"/> class.
/// </summary>
/// <param name="adapter">The adapter for the Log domain.</param>
public V115Log(LogAdapter adapter)
public V118Log(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="V115Network.cs" company="WebDriver Committers">
// <copyright file="V118Network.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.V115.Fetch;
using OpenQA.Selenium.DevTools.V115.Network;
using OpenQA.Selenium.DevTools.V118.Fetch;
using OpenQA.Selenium.DevTools.V118.Network;

namespace OpenQA.Selenium.DevTools.V115
namespace OpenQA.Selenium.DevTools.V118
{
/// <summary>
/// Class providing functionality for manipulating network calls using version 115 of the DevTools Protocol
/// Class providing functionality for manipulating network calls using version 118 of the DevTools Protocol
/// </summary>
public class V115Network : DevTools.Network
public class V118Network : DevTools.Network
{
private FetchAdapter fetch;
private NetworkAdapter network;

/// <summary>
/// Initializes a new instance of the <see cref="V115Network"/> class.
/// Initializes a new instance of the <see cref="V118Network"/> class.
/// </summary>
/// <param name="network">The adapter for the Network domain.</param>
/// <param name="fetch">The adapter for the Fetch domain.</param>
public V115Network(NetworkAdapter network, FetchAdapter fetch)
public V118Network(NetworkAdapter network, FetchAdapter fetch)
{
this.network = network;
this.fetch = fetch;
Expand Down Expand Up @@ -216,9 +216,9 @@ public override async Task ContinueWithAuth(string requestId, string userName, s
await fetch.ContinueWithAuth(new ContinueWithAuthCommandSettings()
{
RequestId = requestId,
AuthChallengeResponse = new V115.Fetch.AuthChallengeResponse()
AuthChallengeResponse = new V118.Fetch.AuthChallengeResponse()
{
Response = V115.Fetch.AuthChallengeResponseResponseValues.ProvideCredentials,
Response = V118.Fetch.AuthChallengeResponseResponseValues.ProvideCredentials,
Username = userName,
Password = password
}
Expand All @@ -235,9 +235,9 @@ public override async Task CancelAuth(string requestId)
await fetch.ContinueWithAuth(new ContinueWithAuthCommandSettings()
{
RequestId = requestId,
AuthChallengeResponse = new OpenQA.Selenium.DevTools.V115.Fetch.AuthChallengeResponse()
AuthChallengeResponse = new OpenQA.Selenium.DevTools.V118.Fetch.AuthChallengeResponse()
{
Response = V115.Fetch.AuthChallengeResponseResponseValues.CancelAuth
Response = V118.Fetch.AuthChallengeResponseResponseValues.CancelAuth
}
}).ConfigureAwait(false);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <copyright file="V115Target.cs" company="WebDriver Committers">
// <copyright file="V118Target.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.V115.Target;
using OpenQA.Selenium.DevTools.V118.Target;

namespace OpenQA.Selenium.DevTools.V115
namespace OpenQA.Selenium.DevTools.V118
{
/// <summary>
/// Class providing functionality for manipulating targets for version 115 of the DevTools Protocol
/// Class providing functionality for manipulating targets for version 118 of the DevTools Protocol
/// </summary>
public class V115Target : DevTools.Target
public class V118Target : DevTools.Target
{
private TargetAdapter adapter;

/// <summary>
/// Initializes a new instance of the <see cref="V115Target"/> class.
/// Initializes a new instance of the <see cref="V118Target"/> class.
/// </summary>
/// <param name="adapter">The adapter for the Target domain.</param>
public V115Target(TargetAdapter adapter)
public V118Target(TargetAdapter adapter)
{
this.adapter = adapter;
adapter.DetachedFromTarget += OnDetachedFromTarget;
Expand Down
14 changes: 7 additions & 7 deletions dotnet/src/webdriver/WebDriver.csproj.prebuild.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v85\DevToolsSession
popd
)

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

if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v116\DevToolsSessionDomains.cs" (
echo Generating CDP code for version 116
pushd "%1..\..\.."
Expand All @@ -47,3 +40,10 @@ if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v117\DevToolsSessio
bazel build //dotnet/src/webdriver/cdp:generate-v117
popd
)

if not exist "%1..\..\..\bazel-bin\dotnet\src\webdriver\cdp\v118\DevToolsSessionDomains.cs" (
echo Generating CDP code for version 118
pushd "%1..\..\.."
bazel build //dotnet/src/webdriver/cdp:generate-v118
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,12 +23,6 @@ then
bazel build //dotnet/src/webdriver/cdp:generate-v85
fi

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

if [[ ! -f "$1../../../bazel-bin/dotnet/src/webdriver/cdp/v116/DevToolsSessionDomains.cs" ]]
then
echo "Generating CDP code for version 116"
Expand All @@ -40,3 +34,9 @@ then
echo "Generating CDP code for version 117"
bazel build //dotnet/src/webdriver/cdp:generate-v117
fi

if [[ ! -f "$1../../../bazel-bin/dotnet/src/webdriver/cdp/v118/DevToolsSessionDomains.cs" ]]
then
echo "Generating CDP code for version 118"
bazel build //dotnet/src/webdriver/cdp:generate-v118
fi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public StableChannelChromeDriver(ChromeDriverService service, ChromeOptions opti

public static ChromeOptions DefaultOptions
{
get { return new ChromeOptions() { BrowserVersion = "117" }; }
get { return new ChromeOptions() { BrowserVersion = "118" }; }
}
}
}
2 changes: 1 addition & 1 deletion dotnet/test/common/DevTools/DevToolsConsoleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace OpenQA.Selenium.DevTools
{
using CurrentCdpVersion = V117;
using CurrentCdpVersion = V118;

[TestFixture]
public class DevToolsConsoleTest : DevToolsTestFixture
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/common/DevTools/DevToolsLogTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace OpenQA.Selenium.DevTools
{
using CurrentCdpVersion = V117;
using CurrentCdpVersion = V118;

[TestFixture]
public class DevToolsLogTest : DevToolsTestFixture
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/common/DevTools/DevToolsNetworkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace OpenQA.Selenium.DevTools
{
using CurrentCdpVersion = V117;
using CurrentCdpVersion = V118;

[TestFixture]
public class DevToolsNetworkTest : DevToolsTestFixture
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/common/DevTools/DevToolsPerformanceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace OpenQA.Selenium.DevTools
{
using CurrentCdpVersion = V117;
using CurrentCdpVersion = V118;

[TestFixture]
public class DevToolsPerformanceTest : DevToolsTestFixture
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/common/DevTools/DevToolsProfilerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace OpenQA.Selenium.DevTools
{
using CurrentCdpVersion = V117;
using CurrentCdpVersion = V118;

[TestFixture]
public class DevToolsProfilerTest : DevToolsTestFixture
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/common/DevTools/DevToolsSecurityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace OpenQA.Selenium.DevTools
{
using CurrentCdpVersion = V117;
using CurrentCdpVersion = V118;

[TestFixture]
public class DevToolsSecurityTest : DevToolsTestFixture
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/common/DevTools/DevToolsTargetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace OpenQA.Selenium.DevTools
{
using CurrentCdpVersion = V117;
using CurrentCdpVersion = V118;

[TestFixture]
public class DevToolsTargetTest : DevToolsTestFixture
Expand Down

0 comments on commit c595b7a

Please sign in to comment.