-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Testing] Fix for flaky device test BlazorWebViewUsesStartPath on Windows #29966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,17 @@ public static partial class WebViewHelpers | |
public static async Task WaitForWebViewReady(WebView2 wv2) | ||
{ | ||
CoreWebView2 coreWebView2 = null; | ||
|
||
// Ensure that the WebView2 runtime is installed and initialized and has a CoreWebView2 instance. | ||
if (wv2?.CoreWebView2 == null) | ||
{ | ||
string version = CoreWebView2Environment.GetAvailableBrowserVersionString(null); | ||
if (string.IsNullOrEmpty(version)) | ||
{ | ||
throw new InvalidOperationException("WebView2 runtime is not installed."); | ||
} | ||
await wv2.EnsureCoreWebView2Async(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this called by the handler already? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mattleibow Yes, it was invoked in the handler already. However, the test failed in CI with the error 'Waited 30000ms but couldn't get CoreWebView2 to be available'. To address this, the call was added again to explicitly ensure proper initialization before the test begins, along with appropriate exception handling. |
||
} | ||
|
||
await Retry(() => | ||
{ | ||
|
Uh oh!
There was an error while loading. Please reload this page.