Repository navigation
Description
Background
TestServices.WindowHelper.SetWindowSizeOverride(Size) is widely used in ported WinUI runtime tests to constrain the test window so layout/viewport-dependent assertions are deterministic. Examples include StackPanelIntegrationTests, GridIntegrationTests, CalendarViewIntegrationTests, and DateTimePickerHelper.
In the current Uno runtime-tests harness, SetWindowSizeOverride is an empty stub:
// src/Uno.UI.RuntimeTests/IntegrationTests/common/TestServices.WindowHelper.cs:423
internal static void SetWindowSizeOverride(object p) { }Because of this, tests that assume a bounded window size can pass on some targets (e.g. SkiaDesktop, where the default window happens to be small) and fail on others (e.g. SkiaWasm, SkiaIOS) where XamlRoot.VisualTree.VisibleBounds is effectively unbounded.
Observed impact
MenuFlyoutIntegrationTests.ValidateSubMenuItemWithLongItemsfails on SkiaWasm/SkiaIOS because the flyout'sMenuFlyoutPresenter.MaxHeightis computed fromVisibleBounds, all 30 items fit, andScrollableHeight == 0.- Any test that uses
SetWindowSizeOverrideto force a small viewport is silently running at the ambient window size instead.
Proposal
Wire TestServices.WindowHelper.SetWindowSizeOverride(Size) (and SetWindowSizeOverrideWithScale) to actually resize the test window / visible bounds across platforms:
- SkiaDesktop (Wpf/Win32/X11/MacOS/Islands/FrameBuffer): resize the host
Windowor XAML island content area. - SkiaWasm: override
NativeWindowWrapper.RaiseNativeSizeChangedinputs for the test, or set the XamlRoot size directly. - SkiaMobile (Android/iOS/MacCatalyst/tvOS): constrain the root visual's size or the
VisibleBoundsused byVisualTree. - Provide a
ResetWindowSizeOverride()/ per-test cleanup so subsequent tests don't inherit the override. - Document expectations (DPI/scale handling, behavior on fullscreen platforms).
Acceptance criteria
SetWindowSizeOverridemeasurably constrainsXamlRoot.VisualTree.VisibleBoundson all Skia targets (Desktop, WASM, Mobile).- Override is cleaned up between tests.
- Tests that depend on a bounded window (e.g. the MenuFlyout long-items scenario) produce consistent results across platforms without per-test workarounds.
Workaround (current)
Tests that need a constrained presenter size apply an explicit MaxHeight via a control style rather than relying on the window override. This works for scenarios where the size can be pushed into the control under test, but not for layout/viewport-level assertions.
Activity
test: Constrain MenuFlyoutPresenter MaxHeight in ValidateSubMenuItemW…
test: Constrain MenuFlyoutPresenter MaxHeight in ValidateSubMenuItemW…
test: Constrain MenuFlyoutPresenter MaxHeight in ValidateSubMenuItemW…
github-actions commentedon Aug 11, 2026
This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.
github-actions commentedon Aug 22, 2026
This issue was closed because it had no activity for 10 days after being marked as stale. If you believe this is still relevant, feel free to reopen it or open a new issue with updated context.
Jen-Uno commentedon Oct 28, 2026
This issue was closed as not planned, so there is nothing for QA to verify. Moving it from Ready for QA Review to Done on the Uno Team Backlog.