Skip to content

Commit

Permalink
revert a bunch of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RenderMichael committed Dec 9, 2024
1 parent 8c84516 commit d7a2f15
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 27 deletions.
7 changes: 2 additions & 5 deletions dotnet/src/webdriver/INetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
using System;
using System.Threading.Tasks;

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand All @@ -32,19 +30,18 @@ public interface INetwork
/// <summary>
/// Occurs when a browser sends a network request.
/// </summary>
event EventHandler<NetworkRequestSentEventArgs>? NetworkRequestSent;
event EventHandler<NetworkRequestSentEventArgs> NetworkRequestSent;

/// <summary>
/// Occurs when a browser receives a network response.
/// </summary>
event EventHandler<NetworkResponseReceivedEventArgs>? NetworkResponseReceived;
event EventHandler<NetworkResponseReceivedEventArgs> NetworkResponseReceived;

/// <summary>
/// Adds a <see cref="NetworkRequestHandler"/> to examine incoming network requests,
/// and optionally modify the request or provide a response.
/// </summary>
/// <param name="handler">The <see cref="NetworkRequestHandler"/> to add.</param>
/// <exception cref="ArgumentNullException">If <paramref name="handler"/> is <see langword="null"/>.</exception>
void AddRequestHandler(NetworkRequestHandler handler);

/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions dotnet/src/webdriver/IOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
// under the License.
// </copyright>

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions dotnet/src/webdriver/ITimeouts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

using System;

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions dotnet/src/webdriver/IWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

using System.Drawing;

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand Down
11 changes: 4 additions & 7 deletions dotnet/src/webdriver/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand All @@ -47,7 +45,7 @@ public NetworkManager(IWebDriver driver)
// StartMonitoring().
this.session = new Lazy<DevToolsSession>(() =>
{
IDevTools? devToolsDriver = driver as IDevTools;
IDevTools devToolsDriver = driver as IDevTools;
if (devToolsDriver == null)
{
throw new WebDriverException("Driver must implement IDevTools to use these features");
Expand All @@ -60,12 +58,12 @@ public NetworkManager(IWebDriver driver)
/// <summary>
/// Occurs when a browser sends a network request.
/// </summary>
public event EventHandler<NetworkRequestSentEventArgs>? NetworkRequestSent;
public event EventHandler<NetworkRequestSentEventArgs> NetworkRequestSent;

/// <summary>
/// Occurs when a browser receives a network response.
/// </summary>
public event EventHandler<NetworkResponseReceivedEventArgs>? NetworkResponseReceived;
public event EventHandler<NetworkResponseReceivedEventArgs> NetworkResponseReceived;

/// <summary>
/// Asynchronously starts monitoring for network traffic.
Expand Down Expand Up @@ -98,7 +96,6 @@ public async Task StopMonitoring()
/// and optionally modify the request or provide a response.
/// </summary>
/// <param name="handler">The <see cref="NetworkRequestHandler"/> to add.</param>
/// <exception cref="ArgumentNullException">If <paramref name="handler"/> is null.</exception>
public void AddRequestHandler(NetworkRequestHandler handler)
{
if (handler == null)
Expand Down Expand Up @@ -203,7 +200,7 @@ private async Task OnAuthRequired(object sender, AuthRequiredEventArgs e)
{
if (authenticationHandler.UriMatcher.Invoke(uri))
{
PasswordCredentials credentials = (PasswordCredentials)authenticationHandler.Credentials;
PasswordCredentials credentials = authenticationHandler.Credentials as PasswordCredentials;
await this.session.Value.Domains.Network.ContinueWithAuth(e.RequestId, credentials.UserName, credentials.Password).ConfigureAwait(false);
successfullyAuthenticated = true;
break;
Expand Down
2 changes: 0 additions & 2 deletions dotnet/src/webdriver/OptionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
// under the License.
// </copyright>

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions dotnet/src/webdriver/Timeouts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
using System.Collections.Generic;
using System.Globalization;

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand Down
8 changes: 3 additions & 5 deletions dotnet/src/webdriver/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
using System.Drawing;
using System.Globalization;

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand Down Expand Up @@ -98,7 +96,7 @@ public Size Size
/// </summary>
public void Maximize()
{
Dictionary<string, object>? parameters = null;
Dictionary<string, object> parameters = null;
this.driver.InternalExecute(DriverCommand.MaximizeWindow, parameters);
}

Expand All @@ -107,7 +105,7 @@ public void Maximize()
/// </summary>
public void Minimize()
{
Dictionary<string, object>? parameters = null;
Dictionary<string, object> parameters = null;
this.driver.InternalExecute(DriverCommand.MinimizeWindow, parameters);
}

Expand All @@ -116,7 +114,7 @@ public void Minimize()
/// </summary>
public void FullScreen()
{
Dictionary<string, object>? parameters = null;
Dictionary<string, object> parameters = null;
this.driver.InternalExecute(DriverCommand.FullScreenWindow, parameters);
}
}
Expand Down

0 comments on commit d7a2f15

Please sign in to comment.