Skip to content

Commit

Permalink
[dotnet] remove deprecated methods for toggling legacy protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jan 19, 2024
1 parent 5eb3caa commit 5893627
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 53 deletions.
21 changes: 0 additions & 21 deletions dotnet/src/webdriver/Chromium/ChromiumOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,27 +185,6 @@ public ChromiumAndroidOptions AndroidOptions
set { this.androidOptions = value; }
}

/// <summary>
/// Gets or sets a value indicating whether the <see cref="ChromiumDriver"/> instance
/// should use the legacy OSS protocol dialect or a dialect compliant with the W3C
/// WebDriver Specification.
/// </summary>
[Obsolete("Spec Compliant Protocol is the only supported protocol")]
public bool UseSpecCompliantProtocol
{
get { return this.useSpecCompliantProtocol; }
set
{
if (!value)
{
throw new ArgumentException("Only the spec compliant protocol is supported, " +
"Please update to W3C Syntax: " +
"https://www.selenium.dev/blog/2022/legacy-protocol-support/");
}
this.useSpecCompliantProtocol = true;
}
}

/// <summary>
/// Adds a single argument to the list of arguments to be appended to the browser executable command line.
/// </summary>
Expand Down
23 changes: 0 additions & 23 deletions dotnet/src/webdriver/Safari/SafariDriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public sealed class SafariDriverService : DriverService
{
private const string DefaultSafariDriverServiceExecutableName = "safaridriver";

private bool useLegacyProtocol;

private readonly static ILogger logger = Log.GetLogger<SafariDriverService>();

/// <summary>
Expand All @@ -55,22 +53,6 @@ protected override DriverOptions GetDefaultDriverOptions()
return new SafariOptions();
}

/// <summary>
/// Gets or sets a value indicating whether to use the default open-source project
/// dialect of the protocol instead of the default dialect compliant with the
/// W3C WebDriver Specification.
/// </summary>
/// <remarks>
/// This is only valid for versions of the driver for Safari that target Safari 12
/// or later, and will result in an error if used with prior versions of the driver.
/// </remarks>
[Obsolete("Only w3c protocol is currently supported")]
public bool UseLegacyProtocol
{
get { return this.useLegacyProtocol; }
set { this.useLegacyProtocol = value; }
}

/// <summary>
/// Gets the command-line arguments for the driver service.
/// </summary>
Expand All @@ -79,11 +61,6 @@ protected override string CommandLineArguments
get
{
StringBuilder argsBuilder = new StringBuilder(base.CommandLineArguments);
if (this.useLegacyProtocol)
{
argsBuilder.Append(" --legacy");
}

return argsBuilder.ToString();
}
}
Expand Down
9 changes: 0 additions & 9 deletions dotnet/test/chrome/ChromeSpecificTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,5 @@ public void RunAfterAnyTests()
EnvironmentManager.Instance.CloseCurrentDriver();
EnvironmentManager.Instance.WebServer.Stop();
}

[Test]
public void W3CFalse()
{
Assert.Throws<ArgumentException>(() => new ChromeOptions
{
UseSpecCompliantProtocol = false
});
}
}
}

0 comments on commit 5893627

Please sign in to comment.