Skip to content

Commit

Permalink
all async executions inside Task need to set configure await to false
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jun 3, 2024
1 parent aa484e9 commit 2153ba2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions dotnet/src/support/Events/EventFiringWebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ public EventFiringNavigation(EventFiringWebDriver driver)
/// </summary>
public void Back()
{
Task.Run(this.BackAsync).GetAwaiter().GetResult();
Task.Run(async () => await this.BackAsync().ConfigureAwait(false)).GetAwaiter().GetResult();
}

/// <summary>
Expand Down Expand Up @@ -875,7 +875,7 @@ public async Task BackAsync()
/// </summary>
public void Forward()
{
Task.Run(this.ForwardAsync).GetAwaiter().GetResult();
Task.Run(async () => await this.ForwardAsync().ConfigureAwait(false)).GetAwaiter().GetResult();
}

/// <summary>
Expand Down Expand Up @@ -904,7 +904,7 @@ public async Task ForwardAsync()
/// <param name="url">String of where you want the browser to go to</param>
public void GoToUrl(string url)
{
Task.Run(() => this.GoToUrlAsync(url)).GetAwaiter().GetResult();
Task.Run(() => this.GoToUrlAsync(url).ConfigureAwait(false)).GetAwaiter().GetResult();
}

/// <summary>
Expand Down Expand Up @@ -939,7 +939,7 @@ public async Task GoToUrlAsync(string url)
/// <param name="url">Uri object of where you want the browser to go to</param>
public void GoToUrl(Uri url)
{
Task.Run(() => this.GoToUrlAsync(url)).GetAwaiter().GetResult();
Task.Run(() => this.GoToUrlAsync(url).ConfigureAwait(false)).GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -962,7 +962,7 @@ public async Task GoToUrlAsync(Uri url)
/// </summary>
public void Refresh()
{
Task.Run(this.RefreshAsync).GetAwaiter().GetResult();
Task.Run(async () => await this.RefreshAsync().ConfigureAwait(false)).GetAwaiter().GetResult();
}

/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions dotnet/src/webdriver/Navigator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public Navigator(WebDriver driver)
/// </summary>
public void Back()
{
Task.Run(this.BackAsync).GetAwaiter().GetResult();
Task.Run(async () => await this.BackAsync().ConfigureAwait(false)).GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -60,7 +60,7 @@ public async Task BackAsync()
/// </summary>
public void Forward()
{
Task.Run(this.ForwardAsync).GetAwaiter().GetResult();
Task.Run(async () => await this.ForwardAsync().ConfigureAwait(false)).GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -78,7 +78,7 @@ public async Task ForwardAsync()
/// <param name="url">String of where you want the browser to go to</param>
public void GoToUrl(string url)
{
Task.Run(() => this.GoToUrlAsync(url)).GetAwaiter().GetResult();
Task.Run(async () => await this.GoToUrlAsync(url).ConfigureAwait(false)).GetAwaiter().GetResult();
}

/// <summary>
Expand Down Expand Up @@ -106,7 +106,7 @@ public async Task GoToUrlAsync(string url)
/// <param name="url">Uri object of where you want the browser to go.</param>
public void GoToUrl(Uri url)
{
Task.Run(() => this.GoToUrlAsync(url)).GetAwaiter().GetResult();
Task.Run(async () => await this.GoToUrlAsync(url).ConfigureAwait(false)).GetAwaiter().GetResult();
}

/// <summary>
Expand All @@ -129,7 +129,7 @@ public async Task GoToUrlAsync(Uri url)
/// </summary>
public void Refresh()
{
Task.Run(this.RefreshAsync).GetAwaiter().GetResult();
Task.Run(async () => await this.RefreshAsync().ConfigureAwait(false)).GetAwaiter().GetResult();
}

/// <summary>
Expand Down

0 comments on commit 2153ba2

Please sign in to comment.