Skip to content

Commit

Permalink
Removing obsolete end points for setting driver timeouts in .NET
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Oct 13, 2015
1 parent 9daa6ce commit 8fba765
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions dotnet/src/webdriver/Remote/RemoteTimeouts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,13 @@ public RemoteTimeouts(RemoteWebDriver driver)
/// </remarks>
public ITimeouts ImplicitlyWait(TimeSpan timeToWait)
{
// The *correct* approach to this timeout is to use the below
// commented line of code and remove the remainder of this method.
// However, we need to use the hard-coded timeout commmand for now,
// since all drivers don't yet understand the generic "timeouts"
// command endpoint.
// this.ExecuteSetTimeout("implicit", timeToWait);
double milliseconds = timeToWait.TotalMilliseconds;
if (timeToWait == TimeSpan.MinValue)
{
milliseconds = -1;
}

if (this.driver.IsSpecificationCompliant)
{
this.ExecuteSetTimeout("implicit", timeToWait);
}
else
{
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("ms", milliseconds);
this.driver.InternalExecute(DriverCommand.ImplicitlyWait, parameters);
}

this.ExecuteSetTimeout("implicit", timeToWait);
return this;
}

Expand All @@ -93,21 +77,13 @@ public ITimeouts ImplicitlyWait(TimeSpan timeToWait)
/// <returns>A self reference</returns>
public ITimeouts SetScriptTimeout(TimeSpan timeToWait)
{
// The *correct* approach to this timeout is to use the below
// commented line of code and remove the remainder of this method.
// However, we need to use the hard-coded timeout commmand for now,
// since all drivers don't yet understand the generic "timeouts"
// command endpoint.
// this.ExecuteSetTimeout("script", timeToWait);
double milliseconds = timeToWait.TotalMilliseconds;
if (timeToWait == TimeSpan.MinValue)
{
milliseconds = -1;
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("ms", milliseconds);
this.driver.InternalExecute(DriverCommand.SetAsyncScriptTimeout, parameters);
this.ExecuteSetTimeout("script", timeToWait);
return this;
}

Expand Down

0 comments on commit 8fba765

Please sign in to comment.