test(dxui): cover the banner's measured height - #119
Merged
Conversation
…rded gap MeasuredHeightPx was the half of the documented test gap still open. It needs a text renderer, which is why it stayed uncovered -- but UnitTest already has a mock that fakes measurement, so the excuse did not survive looking. Three cases, chosen for what can actually go wrong. That measuring beats the estimate is the point of the method: PreferredHeightPx has no renderer, rounds up, and never clips, which is harmless on an auto-sized surface and shows as an empty line inside a fixed dialog. That taller text needs more room is the monotonicity the layout depends on. And that a FAILED measurement falls back to the estimate rather than being believed -- DirectWrite can transiently report a zero-width layout mid-resize, and trusting that would collapse the banner to its padding, which is the same transient the menu bar already caches around. Assertions are relational rather than exact pixels, so tuning the estimate's constants cannot break them. Debug 3024/3024, CheckStyle clean.
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.
Closes the last gap recorded in
docs/disk-write-integrity.md:DxuiInfoBanner::MeasuredHeightPxwas untested because it needs a text renderer — butMockDxuiTextRendereralready fakes measurement, so that reason did not survive checking.Three cases:
PreferredHeightPxhas no renderer, rounds up and never clips — harmless on an auto-sized surface, visible as an empty line inside a fixed dialog.Assertions are relational rather than exact pixels, so tuning the estimate's constants cannot break them.
Debug 3024/3024, CheckStyle clean.
Opened as a PR rather than pushed to master deliberately: the release job is gated
github.event_name == 'push' && github.ref == 'refs/heads/master', so a PR exercises style, build-and-test and build-arm64 without publishing a release while 1.17.0 is on hold.