mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-04-24 07:00:25 +00:00
Use 3s timeout for GetUserAgentAsync and updat test
This commit is contained in:
@@ -388,7 +388,7 @@ public class WebContents : ApiBase
|
||||
/// Returns string - The user agent for this web page.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Task<string> GetUserAgentAsync() => InvokeAsync<string>();
|
||||
public Task<string> GetUserAgentAsync() => InvokeAsyncWithTimeout<string>(3000);
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the user agent for this web page.
|
||||
|
||||
@@ -178,8 +178,12 @@ namespace ElectronNET.IntegrationTests.Tests
|
||||
{
|
||||
////Skip.If(Environment.GetEnvironmentVariable("GITHUB_RUN_ID") != null && RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Skipping test on Windows CI.");
|
||||
|
||||
fx.MainWindow.WebContents.SetUserAgent("MyUserAgent/1.0");
|
||||
await Task.Delay(1000);
|
||||
|
||||
fx.MainWindow.WebContents.SetUserAgent("MyUserAgent/1.0");
|
||||
|
||||
await Task.Delay(1000);
|
||||
|
||||
var ok = await fx.MainWindow.WebContents.GetUserAgentAsync();
|
||||
ok.Should().Be("MyUserAgent/1.0");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user