-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Testing] - Added tests for Graphics IImage Breaking Issues 30350 & 30425 #31665
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
base: main
Are you sure you want to change the base?
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces comprehensive test coverage for two critical image processing bugs in .NET MAUI versions 9.0.80 and 9.0.81. The changes add test pages and automated UI tests to validate IImage.Downsize() functionality and identify issues with image orientation and background thread exceptions on iOS.
- Adds test infrastructure for reproducing image flipping/rotation issues in IImage.Downsize() on iOS 9.0.80+
- Implements test coverage for background thread exceptions when calling IImage.Downsize() on iOS 9.0.81
- Creates automated UI tests to validate both scenarios with proper error handling and status verification
Reviewed Changes
Copilot reviewed 6 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
Issue30350.xaml | XAML page displaying original and downsized images side-by-side to visualize rotation/flipping issues |
Issue30350.xaml.cs | Code-behind implementing image loading, downsizing logic, and property binding for visual comparison |
Issue30350.cs | UI test validating image downsize display functionality through screenshot verification |
Issue30426.xaml | XAML page with controls for loading images, adjusting resize parameters, and processing on background threads |
Issue30426.xaml.cs | Code-behind implementing background thread image processing to reproduce threading exceptions |
Issue30426.cs | UI test verifying successful image loading and processing without exceptions through status message validation |
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 30350, "IImage downsize broken starting from 9.0.80 and not fixed in 9.0.81", PlatformAffected.iOS)] | ||
public partial class Issue30350 : TestContentPage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class does not properly implement INotifyPropertyChanged interface. While it uses OnPropertyChanged() calls, the class should explicitly implement INotifyPropertyChanged and include the event declaration for proper data binding functionality.
Copilot generated this review using guidance from repository custom instructions.
get => _originalSource; | ||
set | ||
{ | ||
if (Equals(value, _originalSource)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Equals() on ImageSource objects may not work as expected since ImageSource doesn't override Equals(). Consider using ReferenceEquals() or implement a custom comparison method.
Copilot uses AI. Check for mistakes.
get => _downsizedSource; | ||
set | ||
{ | ||
if (Equals(value, _downsizedSource)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Equals() on ImageSource objects may not work as expected since ImageSource doesn't override Equals(). Consider using ReferenceEquals() or implement a custom comparison method.
if (Equals(value, _downsizedSource)) | |
if (ReferenceEquals(value, _downsizedSource)) |
Copilot uses AI. Check for mistakes.
Description of Change
This PR reopens the work from the closed #30484
This pull request introduces two new test cases to address image processing issues in MAUI versions 9.0.80 and 9.0.81. It includes XAML and C# implementations for the test pages, along with automated UI tests to verify the behavior. The changes focus on testing the IImage.Downsize() functionality and its handling of image flipping, rotation, and exceptions when invoked from a background thread.
New Test Pages for Image Processing Issues:
Issue30350.xaml and Issue30350.xaml.cs: Added a test page to reproduce and analyze the issue where IImage.Downsize() causes flipped or rotated images on iOS in MAUI 9.0.80+. The page displays the original and downsized images, along with their dimensions, and updates the status dynamically. [1] [2]
Issue30426.xaml and Issue30426.xaml.cs: Added a test page to reproduce and analyze the issue where IImage.Downsize() throws an exception when called from a background thread on iOS in MAUI 9.0.81. The page includes controls to load an image, adjust the resize percentage, and process the image, with error handling and status updates. [1] [2]
Automated UI Tests:
Issue30350.cs: Added a UI test to verify that the downsized image appears correctly without flipping or rotation issues. It checks for the presence of the test control and validates the screenshot.
Issue30426.cs: Added a UI test to ensure that loading and processing an image using IImage.Downsize() does not throw exceptions and completes successfully. The test validates status messages and button interactions.