Skip to content

Commit

Permalink
[.NET] Make DriverService InitializationTimeout property public
Browse files Browse the repository at this point in the history
Also allow the property to be settable. Fixes issue #9150.
  • Loading branch information
jimevans committed Mar 17, 2021
1 parent 49455d0 commit 53a20ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
2 changes: 2 additions & 0 deletions dotnet/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ v4.0.0b2
Nightly. To use this feature, set the EnableDevToolsProtocol property of
FirefoxOptions to true.
* Fixed network interception for use with browsers that support CDP.
* Made DriverService.InitializationTimeout a public settable property. Fixes
issue #9150.

v4.0.0b1
========
Expand Down
18 changes: 10 additions & 8 deletions dotnet/src/webdriver/DriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public abstract class DriverService : ICommandServer
private bool hideCommandPromptWindow;
private bool isDisposed;
private Process driverServiceProcess;
private TimeSpan initializationTimeout = TimeSpan.FromSeconds(20);

/// <summary>
/// Initializes a new instance of the <see cref="DriverService"/> class.
Expand Down Expand Up @@ -166,6 +167,15 @@ public int ProcessId
}
}

/// <summary>
/// Gets or sets a value indicating the time to wait for an initial connection before timing out.
/// </summary>
public TimeSpan InitializationTimeout
{
get { return this.initializationTimeout; }
set { this.initializationTimeout = value; }
}

/// <summary>
/// Gets the executable file name of the driver service.
/// </summary>
Expand All @@ -182,14 +192,6 @@ protected virtual string CommandLineArguments
get { return string.Format(CultureInfo.InvariantCulture, "--port={0}", this.driverServicePort); }
}

/// <summary>
/// Gets a value indicating the time to wait for an initial connection before timing out.
/// </summary>
protected virtual TimeSpan InitializationTimeout
{
get { return TimeSpan.FromSeconds(20); }
}

/// <summary>
/// Gets a value indicating the time to wait for the service to terminate before forcing it to terminate.
/// </summary>
Expand Down
8 changes: 0 additions & 8 deletions dotnet/src/webdriver/Firefox/FirefoxDriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,6 @@ public FirefoxDriverLogLevel LogLevel
set { this.loggingLevel = value; }
}

/// <summary>
/// Gets a value indicating the time to wait for an initial connection before timing out.
/// </summary>
protected override TimeSpan InitializationTimeout
{
get { return TimeSpan.FromSeconds(2); }
}

/// <summary>
/// Gets a value indicating the time to wait for the service to terminate before forcing it to terminate.
/// </summary>
Expand Down

0 comments on commit 53a20ad

Please sign in to comment.