-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fix for WebView Fails to Load URLs with Certain Encoded Characters #27003
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
6332b84
36b0e6e
9d1e5c0
f86e728
a5f3de8
1a1ec99
7a1d98a
9886753
44203e7
47778eb
55cbb10
5dd8b04
c6db857
348cfa7
0315473
c728787
656a162
9a3b6eb
7c67151
09e67b5
06905a0
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 |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| using System.Text; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using System.Net.Http; | ||
| using Microsoft.Extensions.DependencyInjection; | ||
| using Microsoft.Maui.Dispatching; | ||
| using Microsoft.Maui.Platform; | ||
|
|
@@ -266,5 +267,39 @@ public static async Task AssertEventually(this Func<bool> assertion, int timeout | |
| throw new XunitException(message); | ||
| } | ||
| } | ||
| // Add these methods to AssertionExtensions class | ||
| /// <summary> | ||
| /// Checks if internet connection is available by making an HTTP request | ||
| /// </summary> | ||
| /// <returns>True if internet connection is available</returns> | ||
| public static async Task<bool> HasInternetConnection() | ||
|
Contributor
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. Is this necessary? Can't you use the
Contributor
Author
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. @jsuarezruiz , The existing method ( |
||
| { | ||
| try | ||
| { | ||
| using var httpClient = new HttpClient(); | ||
| httpClient.Timeout = TimeSpan.FromSeconds(5); | ||
| using var response = await httpClient.GetAsync("https://1.1.1.1"); | ||
| return response.IsSuccessStatusCode; | ||
| } | ||
| catch | ||
| { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Skips the current test if no internet connection is available | ||
| /// </summary> | ||
| /// <param name="message">Custom message to display when skipping the test</param> | ||
| /// <returns>True if test should be skipped (no internet), false if test can continue</returns> | ||
| public static async Task<bool> SkipTestIfNoInternetConnection(string message = "Test requires internet connection") | ||
| { | ||
| if (!await HasInternetConnection()) | ||
| { | ||
| Assert.True(true, $"TEST SKIPPED: {message}"); | ||
| return true; // Test should be skipped | ||
| } | ||
| return false; // Test can proceed | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.