Use 3s timeout for GetUserAgentAsync and updat test

This commit is contained in:
softworkz
2025-12-06 20:52:45 +01:00
parent 88d2daacb1
commit 9bb2adca78
2 changed files with 6 additions and 2 deletions

View File

@@ -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.

View File

@@ -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");
}