Skip to content

test: Force layout in When_Template_Changed_After_Loaded - #26702

Merged
Xiaoy312 merged 1 commit into
masterfrom
dev/xygu/20261124/fix-template-changed-winui-test
Nov 24, 2026
Merged

Xiaoy312 merged 1 commit into
masterfrom
dev/xygu/20261124/fix-template-changed-winui-test

Conversation

@Xiaoy312

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #26701

PR Type:

🏗️ Build or CI related changes

What changed? 🚀

Given_Control.When_Template_Changed_After_Loaded (added in #26556 for #25217) fails deterministically on the WinAppSDK runtime-test leg: 0/9 on master and 1/18 on PRs since it was added. It passes on every Uno leg (281/281).

On native WinUI, a Template change marks the control dirty but no layout pass gets scheduled. A diagnostic run on WinAppSDK showed:

  • After Template = null + WaitForIdle, the template children are gone but DesiredSize is still the stale 40×20, so no layout ran.
  • After setting the new template + WaitForIdle, there are still no children: the template isn't applied.
  • A single UpdateLayout() applies it at once (ActualWidth 60).
  • Swapping templates directly, without the null step, behaves the same.

The test now calls SUT.UpdateLayout() before its asserts. UpdateLayout only measures dirty elements, so the test still covers the Uno fix:

Run Result
Native WinUI (WinAppSDK) ✅ passes (failed before)
Skia Desktop ✅ passes
Skia Desktop with AffectsMeasure removed from Control.TemplateProperty ❌ fails with "The new template was not applied", as intended

Test-only change, no product code touched.

PR Checklist ✅

🤖 Generated with Claude Code

Native WinUI marks the control dirty when its Template changes but
doesn't schedule a layout pass, so the new template was never applied
after WaitForIdle and the test failed deterministically on the
WinAppSDK leg. UpdateLayout only measures dirty elements, so the test
still fails on Uno without the Template AffectsMeasure fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mergify

mergify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@Xiaoy312
Xiaoy312 enabled auto-merge November 24, 2026 21:47
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 248942 found UI Test snapshots differences: skia-linux-screenshots: 250, skia-windows-screenshots: 306

Details
  • skia-linux-screenshots: 250 changed over 2504

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_Showcase.png-dark
    • AnimatedVisualsTestbedPage.png-dark
    • AutomationProperties_AutomationId.png
    • BenchmarkDotNet.png-dark
    • BenchmarkDotNet.png
    • Accessibility_Showcase.png
    • AppWindowTitleBar Properties.png-dark
    • AppWindowTitleBar Properties.png
    • BitmapIcon_Foreground.png-dark
    • BitmapIcon_Foreground.png
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • AnimatedVisualsTestbedPage.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_StructureAndProps.png
    • BasicAcrylicBrushTest2.png-dark
    • AutomationProperties_StructureAndProps.png-dark
  • skia-windows-screenshots: 306 changed over 2504

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • AnimatedVisualsTestbedPage.png-dark
    • AppWindowTitleBar Properties.png-dark
    • AutomationProperties_StructureAndProps.png-dark
    • Border_CornerRadius_BorderThickness.png-dark
    • Border_CornerRadius_BorderThickness.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • AnimatedBackVisualSourceSamplePage.png
    • AnimatedVisualsTestbedPage.png
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • Buttons.png-dark
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AppWindowTitleBar Properties.png
    • AutomationProperties_AutomationId.png-dark
    • AutomationProperties_StructureAndProps.png

@Xiaoy312
Xiaoy312 merged commit 26ef3bd into master Nov 24, 2026
52 checks passed
@Xiaoy312
Xiaoy312 deleted the dev/xygu/20261124/fix-template-changed-winui-test branch November 24, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WinAppSDK runtime tests: When_Template_Changed_After_Loaded fails on every retry and keeps master red

5 participants