From 41c5b5af6230361909d89298f119d663bfe3db97 Mon Sep 17 00:00:00 2001 From: softworkz Date: Sat, 14 Feb 2026 21:54:45 +0100 Subject: [PATCH] Relax test timings --- .../Tests/BrowserWindowTests.cs | 4 +++- src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ElectronNET.IntegrationTests/Tests/BrowserWindowTests.cs b/src/ElectronNET.IntegrationTests/Tests/BrowserWindowTests.cs index 1be7aa4..26d7d86 100644 --- a/src/ElectronNET.IntegrationTests/Tests/BrowserWindowTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/BrowserWindowTests.cs @@ -266,9 +266,11 @@ namespace ElectronNET.IntegrationTests.Tests try { window = await Electron.WindowManager.CreateWindowAsync( - new BrowserWindowOptions { Show = false, Width = 300, Height = 200 }, + new BrowserWindowOptions { Show = true, Width = 300, Height = 200 }, "about:blank"); + await Task.Delay(5.seconds()); + var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); window.OnBoundsChanged += bounds => tcs.TrySetResult(bounds); diff --git a/src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs b/src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs index 7afae01..6afdc2e 100644 --- a/src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs +++ b/src/ElectronNET.IntegrationTests/Tests/WebContentsTests.cs @@ -174,13 +174,15 @@ namespace ElectronNET.IntegrationTests.Tests try { + await Task.Delay(1.seconds()); + window = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions { Show = true }, "about:blank"); - await Task.Delay(3.seconds()); + await Task.Delay(5.seconds()); window.WebContents.SetUserAgent("MyUserAgent/1.0"); - await Task.Delay(1.seconds()); + await Task.Delay(2.seconds()); var ok = await window.WebContents.GetUserAgentAsync(); ok.Should().Be("MyUserAgent/1.0");