Skip to content
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

feat: Replicate changes made for multi-window support #167

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
GetContent: () => unitTestContentRoot.Content as UIElement,
SetContent: elt => unitTestContentRoot.Content = elt
);
UnitTestsUIContentHelper.CurrentTestWindow = XamlWindow.Current;
UnitTestsUIContentHelper.CurrentTestWindow ??= XamlWindow.Current;
Copy link
Member

Choose a reason for hiding this comment

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

@dr1rrb This doesn't look right.

CurrentTestWindow getter will throw if the field is null. So, attempting to read it here will fail.


DataContext = null;

Expand Down Expand Up @@ -323,7 +323,7 @@
Text = $"{testClass.Name} ({testClass.Assembly.GetName().Name})",
Foreground = new SolidColorBrush(Colors.White),
FontSize = 16d,
IsTextSelectionEnabled = true

Check warning on line 326 in src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs

View workflow job for this annotation

GitHub Actions / build

Microsoft.UI.Xaml.Controls.TextBlock.IsTextSelectionEnabled is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.Controls.TextBlock.IsTextSelectionEnabled) (https://aka.platform.uno/notimplemented)

Check warning on line 326 in src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs

View workflow job for this annotation

GitHub Actions / build

Microsoft.UI.Xaml.Controls.TextBlock.IsTextSelectionEnabled is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.Controls.TextBlock.IsTextSelectionEnabled) (https://aka.platform.uno/notimplemented)

Check warning on line 326 in src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs

View workflow job for this annotation

GitHub Actions / build

Windows.UI.Xaml.Controls.TextBlock.IsTextSelectionEnabled is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Windows.UI.Xaml.Controls.TextBlock.IsTextSelectionEnabled) (https://aka.platform.uno/notimplemented)
};

testResults.Children.Add(testResultBlock);
Expand Down Expand Up @@ -378,7 +378,7 @@
FontFamily = new FontFamily("Courier New"),
Margin = new Thickness(8, 0, 0, 0),
Foreground = new SolidColorBrush(Colors.LightGray),
IsTextSelectionEnabled = true

Check warning on line 381 in src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs

View workflow job for this annotation

GitHub Actions / build

Microsoft.UI.Xaml.Controls.TextBlock.IsTextSelectionEnabled is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.Controls.TextBlock.IsTextSelectionEnabled) (https://aka.platform.uno/notimplemented)

Check warning on line 381 in src/Uno.UI.RuntimeTests.Engine.Library/Engine/UI/UnitTestsControl.cs

View workflow job for this annotation

GitHub Actions / build

Microsoft.UI.Xaml.Controls.TextBlock.IsTextSelectionEnabled is not implemented in Uno (https://aka.platform.uno/notimplemented?m=Microsoft.UI.Xaml.Controls.TextBlock.IsTextSelectionEnabled) (https://aka.platform.uno/notimplemented)
};

var retriesText = _currentRun.CurrentRepeatCount != 0 ? $" (Retried {_currentRun.CurrentRepeatCount} time(s))" : "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public static async ValueTask<TestBitmap> ScreenShot(FrameworkElement element, b
{
case ScreenShotScalingMode.UsePhysicalPixelsWithImplicitScaling:
await renderer.RenderAsync(element);
bitmap = await TestBitmap.From(renderer, element, DisplayInformation.GetForCurrentView()?.RawPixelsPerViewPixel ?? 1);
bitmap = await TestBitmap.From(renderer, element, element.XamlRoot?.RasterizationScale ?? 1);
break;
case ScreenShotScalingMode.UseLogicalPixels:
await renderer.RenderAsync(element, (int)element.RenderSize.Width, (int)element.RenderSize.Height);
Expand Down
Loading