Skip to content

Commit b59557c

Browse files
committed
Resolve conflicts
2 parents 02aa6cf + 0721800 commit b59557c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+718
-425
lines changed

dotnet/src/webdriver/DevTools/DevToolsCommandData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class DevToolsCommandData
3535
/// <summary>
3636
/// Initializes a new instance of the DevToolsCommandData class.
3737
/// </summary>
38-
/// <param name="commandId">The ID of the commmand execution.</param>
38+
/// <param name="commandId">The ID of the command execution.</param>
3939
/// <param name="commandName">The method name of the DevTools command.</param>
4040
/// <param name="commandParameters">The parameters of the DevTools command.</param>
4141
/// <exception cref="ArgumentNullException">If <paramref name="commandName"/> is <see langword="null"/>.</exception>
@@ -47,7 +47,7 @@ public DevToolsCommandData(long commandId, string commandName, JsonNode commandP
4747
/// <summary>
4848
/// Initializes a new instance of the DevToolsCommandData class.
4949
/// </summary>
50-
/// <param name="commandId">The ID of the commmand execution.</param>
50+
/// <param name="commandId">The ID of the command execution.</param>
5151
/// <param name="sessionId">The session ID of the current command execution.</param>
5252
/// <param name="commandName">The method name of the DevTools command.</param>
5353
/// <param name="commandParameters">The parameters of the DevTools command.</param>

dotnet/src/webdriver/DevTools/DevToolsDomains.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public abstract class DevToolsDomains
8282
/// Initializes the supplied DevTools session's domains for the specified browser version.
8383
/// </summary>
8484
/// <param name="protocolVersion">The version of the DevTools Protocol to use.</param>
85-
/// <param name="session">The <see cref="DevToolsSession"/> for which to initialiize the domains.</param>
85+
/// <param name="session">The <see cref="DevToolsSession"/> for which to initialize the domains.</param>
8686
/// <returns>The <see cref="DevToolsDomains"/> object containing the version-specific domains.</returns>
8787
/// <exception cref="ArgumentException">If <paramref name="protocolVersion"/> is negative.</exception>
8888
/// <exception cref="WebDriverException">If the desired protocol version is not supported.</exception>
@@ -95,7 +95,7 @@ public static DevToolsDomains InitializeDomains(int protocolVersion, DevToolsSes
9595
/// Initializes the supplied DevTools session's domains for the specified browser version within the specified number of versions.
9696
/// </summary>
9797
/// <param name="protocolVersion">The version of the DevTools Protocol to use.</param>
98-
/// <param name="session">The <see cref="DevToolsSession"/> for which to initialiize the domains.</param>
98+
/// <param name="session">The <see cref="DevToolsSession"/> for which to initialize the domains.</param>
9999
/// <param name="versionRange">The range of versions within which to match the provided version number. Defaults to 5 versions.</param>
100100
/// <returns>The <see cref="DevToolsDomains"/> object containing the version-specific domains.</returns>
101101
/// <exception cref="ArgumentException">If <paramref name="protocolVersion"/> is negative.</exception>

dotnet/src/webdriver/DevTools/DevToolsSession.cs

Lines changed: 73 additions & 77 deletions
Large diffs are not rendered by default.

dotnet/src/webdriver/DevTools/DevToolsSessionLogMessageEventArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class DevToolsSessionLogMessageEventArgs : EventArgs
5050
/// <param name="level">The level of the log message.</param>
5151
/// <param name="message">The content of the log message.</param>
5252
/// <param name="args">Arguments to be substituted when the message is formatted.</param>
53-
public DevToolsSessionLogMessageEventArgs(DevToolsSessionLogLevel level, string message, params object[] args)
53+
public DevToolsSessionLogMessageEventArgs(DevToolsSessionLogLevel level, string message, params object?[] args)
5454
{
5555
Level = level;
5656
Message = string.Format(message, args);

dotnet/src/webdriver/DevTools/DevToolsVersionInfo.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ public string V8VersionNumber
8888
get
8989
{
9090
//Get the v8 version
91-
var v8VersionRegex = new Regex(@"^(\d+)\.(\d+)\.(\d+)(\.\d+.*)?");
92-
var v8VersionMatch = v8VersionRegex.Match(V8Version);
91+
var v8VersionMatch = Regex.Match(V8Version, @"^(\d+)\.(\d+)\.(\d+)(\.\d+.*)?");
9392
if (v8VersionMatch.Success == false || v8VersionMatch.Groups.Count < 4)
9493
{
9594
throw new InvalidOperationException($"Unable to determine v8 version number from v8 version string ({V8Version})");
@@ -115,8 +114,7 @@ public string WebKitVersionHash
115114
get
116115
{
117116
//Get the webkit version hash.
118-
var webkitVersionRegex = new Regex(@"\s\(@(\b[0-9a-f]{5,40}\b)");
119-
var webkitVersionMatch = webkitVersionRegex.Match(WebKitVersion);
117+
var webkitVersionMatch = Regex.Match(WebKitVersion, @"\s\(@(\b[0-9a-f]{5,40}\b)");
120118
if (webkitVersionMatch.Success == false || webkitVersionMatch.Groups.Count != 2)
121119
{
122120
throw new InvalidOperationException($"Unable to determine webkit version hash from webkit version string ({WebKitVersion})");

dotnet/src/webdriver/DevTools/IDevToolsSession.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
using System.Threading;
2424
using System.Threading.Tasks;
2525

26+
#nullable enable
27+
2628
namespace OpenQA.Selenium.DevTools
2729
{
2830
/// <summary>
@@ -34,18 +36,18 @@ public interface IDevToolsSession : IDisposable
3436
/// <summary>
3537
/// Event raised when the DevToolsSession logs informational messages.
3638
/// </summary>
37-
event EventHandler<DevToolsSessionLogMessageEventArgs> LogMessage;
39+
event EventHandler<DevToolsSessionLogMessageEventArgs>? LogMessage;
3840

3941
/// <summary>
4042
/// Event raised an event notification is received from the DevTools session.
4143
/// </summary>
42-
event EventHandler<DevToolsEventReceivedEventArgs> DevToolsEventReceived;
44+
event EventHandler<DevToolsEventReceivedEventArgs>? DevToolsEventReceived;
4345

4446
/// <summary>
45-
/// Gets the domains that are valid for the specfied version of Developer Tools connection.
47+
/// Gets the domains that are valid for the specified version of Developer Tools connection.
4648
/// </summary>
4749
/// <typeparam name="T">
48-
/// A <see cref="DevToolsSessionDomains"/> type specific to the version of Develoepr Tools with which to communicate.
50+
/// A <see cref="DevToolsSessionDomains"/> type specific to the version of Developer Tools with which to communicate.
4951
/// </typeparam>
5052
/// <returns>The version-specific domains for this Developer Tools connection.</returns>
5153
T GetVersionSpecificDomains<T>() where T : DevToolsSessionDomains;
@@ -59,7 +61,7 @@ public interface IDevToolsSession : IDisposable
5961
/// <param name="millisecondsTimeout">The execution timeout of the command in milliseconds.</param>
6062
/// <param name="throwExceptionIfResponseNotReceived"><see langword="true"/> to throw an exception if a response is not received; otherwise, <see langword="false"/>.</param>
6163
/// <returns>The command response object implementing the <see cref="ICommandResponse{T}"/> interface.</returns>
62-
Task<ICommandResponse<TCommand>> SendCommand<TCommand>(TCommand command, CancellationToken cancellationToken, int? millisecondsTimeout, bool throwExceptionIfResponseNotReceived)
64+
Task<ICommandResponse<TCommand>?> SendCommand<TCommand>(TCommand command, CancellationToken cancellationToken, int? millisecondsTimeout, bool throwExceptionIfResponseNotReceived)
6365
where TCommand : ICommand;
6466

6567
/// <summary>
@@ -72,7 +74,7 @@ Task<ICommandResponse<TCommand>> SendCommand<TCommand>(TCommand command, Cancell
7274
/// <param name="millisecondsTimeout">The execution timeout of the command in milliseconds.</param>
7375
/// <param name="throwExceptionIfResponseNotReceived"><see langword="true"/> to throw an exception if a response is not received; otherwise, <see langword="false"/>.</param>
7476
/// <returns>The command response object implementing the <see cref="ICommandResponse{T}"/> interface.</returns>
75-
Task<TCommandResponse> SendCommand<TCommand, TCommandResponse>(TCommand command, CancellationToken cancellationToken, int? millisecondsTimeout, bool throwExceptionIfResponseNotReceived)
77+
Task<TCommandResponse?> SendCommand<TCommand, TCommandResponse>(TCommand command, CancellationToken cancellationToken, int? millisecondsTimeout, bool throwExceptionIfResponseNotReceived)
7678
where TCommand : ICommand
7779
where TCommandResponse : ICommandResponse<TCommand>;
7880

dotnet/src/webdriver/DevTools/JavaScript.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
using System;
2121
using System.Threading.Tasks;
2222

23+
#nullable enable
24+
2325
namespace OpenQA.Selenium.DevTools
2426
{
2527
/// <summary>
@@ -30,17 +32,17 @@ public abstract class JavaScript
3032
/// <summary>
3133
/// Occurs when a JavaScript script binding is called.
3234
/// </summary>
33-
public event EventHandler<BindingCalledEventArgs> BindingCalled;
35+
public event EventHandler<BindingCalledEventArgs>? BindingCalled;
3436

3537
/// <summary>
3638
/// Occurs when the browser's JavaScript console API is called.
3739
/// </summary>
38-
public event EventHandler<ConsoleApiCalledEventArgs> ConsoleApiCalled;
40+
public event EventHandler<ConsoleApiCalledEventArgs>? ConsoleApiCalled;
3941

4042
/// <summary>
4143
/// Occurs when a JavaScript exception is thrown.
4244
/// </summary>
43-
public event EventHandler<ExceptionThrownEventArgs> ExceptionThrown;
45+
public event EventHandler<ExceptionThrownEventArgs>? ExceptionThrown;
4446

4547
/// <summary>
4648
/// Asynchronously enables the Runtime domain in the DevTools Protocol.

dotnet/src/webdriver/DevTools/Log.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
using System;
2121
using System.Threading.Tasks;
2222

23+
#nullable enable
24+
2325
namespace OpenQA.Selenium.DevTools
2426
{
2527
/// <summary>
@@ -30,7 +32,7 @@ public abstract class Log
3032
/// <summary>
3133
/// Occurs when an entry is added to the browser's log.
3234
/// </summary>
33-
public event EventHandler<EntryAddedEventArgs> EntryAdded;
35+
public event EventHandler<EntryAddedEventArgs>? EntryAdded;
3436

3537
/// <summary>
3638
/// Asynchronously enables manipulation of the browser's log.

dotnet/src/webdriver/DevTools/Target.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
using System.Collections.ObjectModel;
2222
using System.Threading.Tasks;
2323

24+
#nullable enable
25+
2426
namespace OpenQA.Selenium.DevTools
2527
{
2628
/// <summary>
@@ -31,12 +33,12 @@ public abstract class Target
3133
/// <summary>
3234
/// Occurs when a target is detached.
3335
/// </summary>
34-
public event EventHandler<TargetDetachedEventArgs> TargetDetached;
36+
public event EventHandler<TargetDetachedEventArgs>? TargetDetached;
3537

3638
/// <summary>
3739
/// Occurs when a target is attached.
3840
/// </summary>
39-
public event EventHandler<TargetAttachedEventArgs> TargetAttached;
41+
public event EventHandler<TargetAttachedEventArgs>? TargetAttached;
4042

4143
/// <summary>
4244
/// Asynchronously gets the targets available for this session.
@@ -46,7 +48,7 @@ public abstract class Target
4648
/// contains the list of <see cref="TargetInfo"/> objects describing the
4749
/// targets available for this session.
4850
/// </returns>
49-
public abstract Task<ReadOnlyCollection<TargetInfo>> GetTargets(Object settings = null);
51+
public abstract Task<ReadOnlyCollection<TargetInfo>> GetTargets(object? settings = null);
5052

5153
/// <summary>
5254
/// Asynchronously attaches to a target.
@@ -66,7 +68,7 @@ public abstract class Target
6668
/// <returns>
6769
/// A task representing the asynchronous detach operation.
6870
/// </returns>
69-
public abstract Task DetachFromTarget(string sessionId = null, string targetId = null);
71+
public abstract Task DetachFromTarget(string? sessionId = null, string? targetId = null);
7072

7173
/// <summary>
7274
/// Asynchronously sets the DevTools Protocol connection to automatically attach to new targets.

dotnet/src/webdriver/DevTools/TargetInfo.cs

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,69 @@
1717
// under the License.
1818
// </copyright>
1919

20+
#nullable enable
21+
2022
namespace OpenQA.Selenium.DevTools
2123
{
2224
/// <summary>
2325
/// Represents information about the target of a DevTools Protocol command
2426
/// </summary>
2527
public class TargetInfo
2628
{
29+
/// <summary>
30+
/// Initializes a new instance of the <see cref="TargetInfo"/> type.
31+
/// </summary>
32+
/// <param name="targetId">The ID of the target.</param>
33+
/// <param name="type">The type of target.</param>
34+
/// <param name="title">The title of the target.</param>
35+
/// <param name="url">The URL of the target.</param>
36+
/// <param name="isAttached">Whether the protocol is attached to the target.</param>
37+
/// <param name="openerId">The ID of the opener of the target.</param>
38+
/// <param name="browserContextId">The browser context ID.</param>
39+
public TargetInfo(string targetId, string type, string title, string url, bool isAttached, string? openerId, string? browserContextId)
40+
{
41+
this.TargetId = targetId;
42+
this.Type = type;
43+
this.Title = title;
44+
this.Url = url;
45+
this.IsAttached = isAttached;
46+
this.OpenerId = openerId;
47+
this.BrowserContextId = browserContextId;
48+
}
49+
2750
/// <summary>
2851
/// Gets the ID of the target.
2952
/// </summary>
30-
public string TargetId { get; internal set; }
53+
public string TargetId { get; }
3154

3255
/// <summary>
3356
/// Gets the type of target.
3457
/// </summary>
35-
public string Type { get; internal set; }
58+
public string Type { get; }
3659

3760
/// <summary>
3861
/// Gets the title of the target.
3962
/// </summary>
40-
public string Title { get; internal set; }
63+
public string Title { get; }
4164

4265
/// <summary>
4366
/// Gets the URL of the target.
4467
/// </summary>
45-
public string Url { get; internal set; }
68+
public string Url { get; }
4669

4770
/// <summary>
4871
/// Gets a value indicating if the protocol is attached to the target.
4972
/// </summary>
50-
public bool IsAttached { get; internal set; }
73+
public bool IsAttached { get; }
5174

5275
/// <summary>
5376
/// Gets the ID of the opener of the target.
5477
/// </summary>
55-
public string OpenerId { get; internal set; }
78+
public string? OpenerId { get; }
5679

5780
/// <summary>
5881
/// Gets the browser context ID.
5982
/// </summary>
60-
public string BrowserContextId { get; internal set; }
83+
public string? BrowserContextId { get; }
6184
}
6285
}

0 commit comments

Comments
 (0)