Repository navigation
test: add app-level theme change scenario + fix DatePicker/TimePicker theme test failures (backport #23211) - #23247
Merged
agneszitte merged 2 commits intoMay 11, 2026
Conversation
Adds runtime test covering the exact CSharpMarkup ThemeBindingProvider pattern: app-level theme change → ActualThemeChanged fires → handler reads ActualTheme to select theme dictionary → resolves resource. This test targets the combination not covered by existing tests: - When_AppTheme_Changes_ActualTheme_Returns_New_Value_In_Handler covers app-level theme (no resource resolution) - When_ThemeResource_Resolved_During_ActualThemeChanged_Returns_New_Value covers resource resolution (local RequestedTheme only) The new test validates both together, matching the real-world failure that caused the CSharpMarkup canary regression. Related to #23178, #23197 (cherry picked from commit c6c9b39)
(cherry picked from commit 643683a)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a runtime test covering the exact CSharpMarkup
ThemeBindingProviderpattern: app-level theme change →ActualThemeChangedfires → handler readsActualThemeto select theme dictionary → resolves resource from it.Also fixes iOS DatePicker/TimePicker native flyout theme tests that fail because
ThemeHelper.UseApplicationDarkTheme()now requires[RequiresFullWindow].What
When_AppTheme_Changes_ThemeResource_Resolved_During_Event_Returns_New_ValueActualThemereturns the new theme (not stale) when resolved insideActualThemeChangedduring an app-level theme switch, and that ThemeResource lookup from the correct dictionary succeeds.[RequiresFullWindow]attribute toGiven_DatePicker.When_App_Theme_Dark_Native_Flyout_Theme(iOS) andGiven_TimePicker.When_App_Theme_Dark_Native_Flyout_Theme(Apple UIKit).Why
PR #23197 fixed the root cause (
SetThemewas called afterRaiseActualThemeChangedinstead of before) and included tests for:RequestedThemechange with resource resolution (When_ThemeResource_Resolved_During_ActualThemeChanged_Returns_New_Value)When_AppTheme_Changes_ActualTheme_Returns_New_Value_In_Handler)This PR adds the missing combination: app-level theme change with resource resolution — which is the exact scenario that caused the CSharpMarkup canary regression.
The DatePicker/TimePicker fix addresses
ThemeHelper.AssertFullWindowForApplicationTheme()guard failures introduced by the same theme infrastructure changes — the tests callUseApplicationDarkTheme()which now requires the test method to be annotated with[RequiresFullWindow].Related
This is an automatic backport of pull request test: add app-level theme change scenario + fix DatePicker/TimePicker theme test failures #23211 done by Mergify.