Skip to content

Commit 1dcbcc2

Browse files
committed
[dotnet] Linting and suppressing compiler warnings
1 parent fa1ee12 commit 1dcbcc2

Some content is hidden

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

52 files changed

+489
-129
lines changed

dotnet/src/webdriver/Chromium/ChromiumAndroidOptions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public bool UseRunningApp
4646
}
4747

4848
/// <summary>
49-
/// Gets or sets the process name of the Activity hosting the app. If not given, it
50-
/// is assumed to be the same as <see cref="AndroidActivity"/>.
49+
/// Gets or sets the process name of the Activity hosting the app.
5150
/// </summary>
5251
public string AndroidProcess
5352
{

dotnet/src/webdriver/Chromium/ChromiumDriver.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ protected ChromiumDriver(ChromiumDriverService service, ChromiumOptions options,
131131
this.optionsCapabilityName = options.CapabilityName;
132132
}
133133

134+
/// <summary>
135+
/// Gets the dictionary of custom Chromium commands registered with the driver.
136+
/// </summary>
137+
protected static IReadOnlyDictionary<string, CommandInfo> ChromiumCustomCommands
138+
{
139+
get { return new ReadOnlyDictionary<string, CommandInfo>(chromiumCustomCommands); }
140+
}
141+
134142
/// <summary>
135143
/// Uses DriverFinder to set Service attributes if necessary when creating the command executor
136144
/// </summary>
@@ -148,11 +156,6 @@ private static ICommandExecutor GenerateDriverServiceCommandExecutor(DriverServi
148156
return new DriverServiceCommandExecutor(service, commandTimeout);
149157
}
150158

151-
protected static IReadOnlyDictionary<string, CommandInfo> ChromiumCustomCommands
152-
{
153-
get { return new ReadOnlyDictionary<string, CommandInfo>(chromiumCustomCommands); }
154-
}
155-
156159
/// <summary>
157160
/// Gets or sets the <see cref="IFileDetector"/> responsible for detecting
158161
/// sequences of keystrokes representing file paths and names.
@@ -265,7 +268,6 @@ public object ExecuteCdpCommand(string commandName, Dictionary<string, object> c
265268
/// <summary>
266269
/// Creates a session to communicate with a browser using the Chromium Developer Tools debugging protocol.
267270
/// </summary>
268-
/// <param name="devToolsProtocolVersion">The version of the Chromium Developer Tools protocol to use. Defaults to autodetect the protocol version.</param>
269271
/// <returns>The active session to use to communicate with the Chromium Developer Tools debugging protocol.</returns>
270272
public DevToolsSession GetDevToolsSession()
271273
{
@@ -435,6 +437,10 @@ public void StopCasting(string deviceName)
435437
this.Execute(StopCastingCommand, parameters);
436438
}
437439

440+
/// <summary>
441+
/// Stops the driver from running
442+
/// </summary>
443+
/// <param name="disposing">if its in the process of disposing</param>
438444
protected override void Dispose(bool disposing)
439445
{
440446
if (disposing)

dotnet/src/webdriver/Chromium/ChromiumDriverService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public abstract class ChromiumDriverService : DriverService
4545
/// <param name="executablePath">The full path to the ChromeDriver executable.</param>
4646
/// <param name="executableFileName">The file name of the ChromeDriver executable.</param>
4747
/// <param name="port">The port on which the ChromeDriver executable should listen.</param>
48+
/// <param name="downloadUrl">The URL from which the driver executable can be downloaded.</param>
4849
protected ChromiumDriverService(string executablePath, string executableFileName, int port, Uri downloadUrl = null)
4950
: base(executablePath, port, executableFileName)
5051
{

dotnet/src/webdriver/Chromium/ChromiumNetworkConditions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ internal long? SerializableLatency
9797
}
9898
}
9999

100+
/// <summary>
101+
/// Creates a ChromiumNetworkConditions object from a dictionary of key-value pairs.
102+
/// </summary>
103+
/// <param name="dictionary">The dictionary to use to create the object.</param>
104+
/// <returns>The ChromiumNetworkConditions object created from the dictionary.</returns>
100105
public static ChromiumNetworkConditions FromDictionary(Dictionary<string, object> dictionary)
101106
{
102107
ChromiumNetworkConditions conditions = new ChromiumNetworkConditions();

dotnet/src/webdriver/CommandInfoRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public bool IsCommandNameDefined(string commandName)
6464
/// Finds a command name for a given <see cref="CommandInfo"/>.
6565
/// </summary>
6666
/// <param name="commandInfo">The <see cref="CommandInfo"/> object for which to find the command name.</param>
67-
/// <returns>The name of the command defined by the command info, or <see langword=""="null"/> if the command is not defined.</returns>
67+
/// <returns>The name of the command defined by the command info, or <see langword="null"/> if the command is not defined.</returns>
6868
public string FindCommandName(CommandInfo commandInfo)
6969
{
7070
foreach(KeyValuePair<string, CommandInfo> pair in this.commandDictionary)

dotnet/src/webdriver/DevTools/DevToolsSession.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ namespace OpenQA.Selenium.DevTools
3636
///</summary>
3737
public class DevToolsSession : IDevToolsSession
3838
{
39+
/// <summary>
40+
/// A value indicating that the version of the DevTools protocol in use
41+
/// by the browser should be automatically detected.
42+
/// </summary>
3943
public const int AutoDetectDevToolsProtocolVersion = 0;
4044

4145
private readonly string debuggerEndpoint;
@@ -158,9 +162,9 @@ public T GetVersionSpecificDomains<T>() where T : DevToolsSessionDomains
158162
/// <summary>
159163
/// Sends the specified command and returns the associated command response.
160164
/// </summary>
161-
/// <typeparam name="TCommand"></typeparam>
162-
/// <typeparam name="TCommandResponse"></typeparam>
163165
/// <typeparam name="TCommand">A command object implementing the <see cref="ICommand"/> interface.</typeparam>
166+
/// <typeparam name="TCommandResponse">A response object implementing the <see cref="ICommandResponse"/> interface.</typeparam>
167+
/// <param name="command">The command to send.</param>
164168
/// <param name="cancellationToken">A CancellationToken object to allow for cancellation of the command.</param>
165169
/// <param name="millisecondsTimeout">The execution timeout of the command in milliseconds.</param>
166170
/// <param name="throwExceptionIfResponseNotReceived"><see langword="true"/> to throw an exception if a response is not received; otherwise, <see langword="false"/>.</param>
@@ -262,8 +266,8 @@ public T GetVersionSpecificDomains<T>() where T : DevToolsSessionDomains
262266
}
263267

264268
/// <summary>
265-
/// Disposes of the DevToolsSession and frees all resources.
266-
///</summary>
269+
/// Releases all resources associated with this <see cref="DevToolsSession"/>.
270+
/// </summary>
267271
public void Dispose()
268272
{
269273
this.Dispose(true);
@@ -296,7 +300,7 @@ internal async Task StartSession(int requestedProtocolVersion)
296300
/// Asynchronously stops the session.
297301
/// </summary>
298302
/// <param name="manualDetach"><see langword="true"/> to manually detach the session
299-
/// from its attached target; otherswise <see langword="false""/>.</param>
303+
/// from its attached target; otherswise <see langword="false"/>.</param>
300304
/// <returns>A task that represents the asynchronous operation.</returns>
301305
internal async Task StopSession(bool manualDetach)
302306
{
@@ -314,6 +318,10 @@ internal async Task StopSession(bool manualDetach)
314318
}
315319
}
316320

321+
/// <summary>
322+
/// Releases all resources associated with this <see cref="DevToolsSession"/>.
323+
/// </summary>
324+
/// <param name="disposing"><see langword="true"/> if the Dispose method was explicitly called; otherwise, <see langword="false"/>.</param>
317325
protected void Dispose(bool disposing)
318326
{
319327
if (!this.isDisposed)

dotnet/src/webdriver/DevTools/IDevToolsSession.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ Task<ICommandResponse<TCommand>> SendCommand<TCommand>(TCommand command, Cancell
6464
/// <summary>
6565
/// Sends the specified command and returns the associated command response.
6666
/// </summary>
67-
/// <typeparam name="TCommand"></typeparam>
68-
/// <typeparam name="TCommandResponse"></typeparam>
6967
/// <typeparam name="TCommand">A command object implementing the <see cref="ICommand"/> interface.</typeparam>
68+
/// <typeparam name="TCommandResponse">A response object implementing the <see cref="ICommandResponse"/> interface.</typeparam>
69+
/// <param name="command">The command to send.</param>
7070
/// <param name="cancellationToken">A CancellationToken object to allow for cancellation of the command.</param>
7171
/// <param name="millisecondsTimeout">The execution timeout of the command in milliseconds.</param>
7272
/// <param name="throwExceptionIfResponseNotReceived"><see langword="true"/> to throw an exception if a response is not received; otherwise, <see langword="false"/>.</param>

dotnet/src/webdriver/DevTools/Network.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ protected virtual void OnResponsePaused(ResponsePausedEventArgs e)
197197
}
198198
}
199199

200+
/// <returns>A task that represents the asynchronous operation.</returns>
201+
/// <summary>
202+
/// Am asynchrounous delegate for handling network events.
203+
/// </summary>
204+
/// <typeparam name="TEventArgs">The type of event args the event raises.</typeparam>
205+
/// <param name="sender">The sender of the event.</param>
206+
/// <param name="e">An object containing information about the event.</param>
207+
/// <returns>A task that represents the asynchronous operation.</returns>
200208
public delegate Task AsyncEventHandler<TEventArgs>(object sender, TEventArgs e);
201209
}
202210
}

dotnet/src/webdriver/DevTools/v114/V114Domains.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ public class V114Domains : DevToolsDomains
2828
{
2929
private DevToolsSessionDomains domains;
3030

31+
/// <summary>
32+
/// Initializes a new instance of the V114Domains class.
33+
/// </summary>
34+
/// <param name="session">The DevToolsSession to use with this set of domains.</param>
3135
public V114Domains(DevToolsSession session)
3236
{
3337
this.domains = new DevToolsSessionDomains(session);

dotnet/src/webdriver/DevTools/v114/V114Network.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,19 @@ public override async Task EnableNetworkCaching()
6464
await network.SetCacheDisabled(new SetCacheDisabledCommandSettings() { CacheDisabled = false });
6565
}
6666

67+
/// <summary>
68+
/// Asynchronously enables the Network domain..
69+
/// </summary>
70+
/// <returns>A task that represents the asynchronous operation.</returns>
6771
public override async Task EnableNetwork()
6872
{
6973
await network.Enable(new Network.EnableCommandSettings());
7074
}
7175

76+
/// <summary>
77+
/// Asynchronously disables the Network domain..
78+
/// </summary>
79+
/// <returns>A task that represents the asynchronous operation.</returns>
7280
public override async Task DisableNetwork()
7381
{
7482
await network.Disable();

0 commit comments

Comments
 (0)