Skip to content

Commit

Permalink
Remove Wait for windows handle on Restart
Browse files Browse the repository at this point in the history
  • Loading branch information
budcribar committed Feb 24, 2024
1 parent aa18e38 commit f9a2722
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<Project>
<PropertyGroup>
<PackageOutputPath>$(MSBuildThisFileDirectory)artifacts</PackageOutputPath>
<VersionPrefix>8.0.2</VersionPrefix>
<VersionPrefix>8.0.3</VersionPrefix>
</PropertyGroup>
</Project>
16 changes: 1 addition & 15 deletions src/RemoteWebView/RemoteWebView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,6 @@ public static void Restart(IBlazorWebView blazorWebView)
StartInfo = psi
};
p.Start();

int i = 0;
// Try to prevent COMException 0x8007139F
while (p.MainWindowHandle == IntPtr.Zero)
{
// Refresh process property values
p.Refresh();

// Wait a bit before checking again
Thread.Sleep(100);
i++;
if (i >= 100)
break;
}
}

private ILogger Logger { get; set; }
Expand Down Expand Up @@ -147,7 +133,7 @@ public static void Restart(IBlazorWebView blazorWebView)
protected WebViewIPC.WebViewIPCClient? Client()
{
if (BlazorWebView.ServerUri == null) return null;

if (BlazorWebView.GrpcBaseUri == null) return null;
PingIntervalSeconds = BlazorWebView.PingIntervalSeconds;

if (client == null)
Expand Down
2 changes: 1 addition & 1 deletion testassets/NUnitTestProject/TestRemoteBlazorWpf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class TestRemoteBlazorWpf
protected static string[] ids = Array.Empty<string>();
protected static Process? process;
protected static List<Process> clients = new();
protected static int NUM_LOOPS_WAITING_FOR_PAGE_LOAD = 100;
protected static int NUM_LOOPS_WAITING_FOR_PAGE_LOAD = 200;

public virtual Process CreateClient()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace WebdriverTestProject
{
[Ignore]
[TestClass]
public class TestRemoteEmbeddedBlazorWebView : TestRemoteBlazorWpf
{
Expand Down
1 change: 0 additions & 1 deletion testassets/NUnitTestProject/WebdriverTestProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

</ItemGroup>
<ItemGroup>
<Compile Remove="TestRemoteEmbeddedBlazorWebView.cs" />
<Compile Remove="TestRemotePackageBlazorForm.cs" />
</ItemGroup>

Expand Down

0 comments on commit f9a2722

Please sign in to comment.