Skip to content

Commit

Permalink
.NET bindings code linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Jun 3, 2019
1 parent 251cd38 commit fa0bbc9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
1 change: 0 additions & 1 deletion dotnet/src/webdriver/Chrome/ChromeDriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public sealed class ChromeDriverService : ChromiumDriverService

private static readonly Uri ChromeDriverDownloadUrl = new Uri("http://chromedriver.storage.googleapis.com/index.html");


/// <summary>
/// Initializes a new instance of the <see cref="ChromeDriverService"/> class.
/// </summary>
Expand Down
25 changes: 17 additions & 8 deletions dotnet/src/webdriver/Edge/EdgeDriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ namespace OpenQA.Selenium.Edge
public sealed class EdgeDriverService : ChromiumDriverService
{
private const string MicrosoftWebDriverServiceFileName = "MicrosoftWebDriver.exe";
private const string MSEdgeDriverServiceFileName = "MSEdgeDriver.exe";
private static readonly Uri MicrosoftWebDriverDownloadUrl = new Uri("https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/");
private string host;
private string package;
private bool useVerboseLogging;
private bool? useSpecCompliantProtocol;
private const string MSEdgeDriverServiceFileName = "MSEdgeDriver.exe";
private bool isLegacy;

/// <summary>
Expand Down Expand Up @@ -209,7 +209,9 @@ protected override string CommandLineArguments
get
{
if (!this.isLegacy)
{
return base.CommandLineArguments;
}

StringBuilder argsBuilder = new StringBuilder(base.CommandLineArguments);
if (!string.IsNullOrEmpty(this.host))
Expand Down Expand Up @@ -255,9 +257,13 @@ protected override string CommandLineArguments
/// <returns>A EdgeDriverService that implements default settings.</returns>
public static EdgeDriverService CreateDefaultService(bool isLegacy = true)
{
string serviceDirectory = DriverService.FindDriverServiceExecutable(
isLegacy ? MicrosoftWebDriverServiceFileName : ChromiumDriverServiceFileName(MSEdgeDriverServiceFileName),
MicrosoftWebDriverDownloadUrl);
string serviceFileName = ChromiumDriverServiceFileName(MSEdgeDriverServiceFileName);
if (isLegacy)
{
serviceFileName = MicrosoftWebDriverServiceFileName;
}

string serviceDirectory = DriverService.FindDriverServiceExecutable(serviceFileName, MicrosoftWebDriverDownloadUrl);
EdgeDriverService service = CreateDefaultService(serviceDirectory, isLegacy);
return service;
}
Expand All @@ -270,10 +276,13 @@ public static EdgeDriverService CreateDefaultService(bool isLegacy = true)
/// <returns>A EdgeDriverService using a random port.</returns>
public static EdgeDriverService CreateDefaultService(string driverPath, bool isLegacy = true)
{
return CreateDefaultService(
driverPath,
isLegacy ? MicrosoftWebDriverServiceFileName : ChromiumDriverServiceFileName(MSEdgeDriverServiceFileName),
isLegacy);
string serviceFileName = ChromiumDriverServiceFileName(MSEdgeDriverServiceFileName);
if (isLegacy)
{
serviceFileName = MicrosoftWebDriverServiceFileName;
}

return CreateDefaultService(driverPath, serviceFileName, isLegacy);
}

/// <summary>
Expand Down

0 comments on commit fa0bbc9

Please sign in to comment.