Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue12134.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ private async void DisplayCookies()

private async void WebViewOnNavigated(object sender, WebNavigatedEventArgs e)
{
#if ANDROID
var result = await Task.FromResult(Android.Webkit.CookieManager.Instance?.GetCookie("https://dotnet.microsoft.com"));
#else
var result = await ((WebView)sender).EvaluateJavaScriptAsync("document.cookie");
#endif
_label.Text = result.Contains(_guid.ToString(), StringComparison.OrdinalIgnoreCase) ? "Success" : "Failed";

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android.Webkit.CookieManager.Instance?.GetCookie(...) can return null (or the Instance can be null), and the next line calls result.Contains(...), which will throw on Android. Please make the check null-safe and treat null/empty as "Failed".

Suggested change
_label.Text = result.Contains(_guid.ToString(), StringComparison.OrdinalIgnoreCase) ? "Success" : "Failed";
var success = !string.IsNullOrEmpty(result) && result.Contains(_guid.ToString(), StringComparison.OrdinalIgnoreCase);
_label.Text = success ? "Success" : "Failed";

Copilot uses AI. Check for mistakes.
}

Expand Down
2 changes: 1 addition & 1 deletion src/Controls/tests/TestCases.HostApp/Issues/Issue18452.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ protected override void Init()
Content = grid;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public void ApplyingRotationWithZeroDurationShouldNotCrash()
{
App.WaitForElement("RotateButton");
App.Tap("RotateButton");
App.WaitForElement("RotateButton");
App.Tap("RotateButton");
App.WaitForElement("RotateButton");
App.Tap("RotateButton");
App.WaitForElement("RotateButton");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public void SafeAreaBorderOrientationLandscapeToPortrait()

[Test]
[Category(UITestCategories.SafeAreaEdges)]
[Retry(2)]
public void SafeAreaBorderMultipleOrientationChanges()
{
var borderContent = App.WaitForElement("BorderContent");
Expand Down
Loading