Skip to content

test(dxui): cover the banner's measured height - #119

Merged
relmer merged 1 commit into
masterfrom
ci/banner-measured-height
Aug 21, 2026
Merged

test(dxui): cover the banner's measured height#119
relmer merged 1 commit into
masterfrom
ci/banner-measured-height

Conversation

@relmer

@relmer relmer commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Closes the last gap recorded in docs/disk-write-integrity.md: DxuiInfoBanner::MeasuredHeightPx was untested because it needs a text renderer — but MockDxuiTextRenderer already fakes measurement, so that reason did not survive checking.

Three cases:

  • Measuring beats the estimate. That is the method's whole purpose. PreferredHeightPx has no renderer, rounds up and never clips — harmless on an auto-sized surface, visible as an empty line inside a fixed dialog.
  • Taller text needs more room. The monotonicity the layout depends on.
  • A failed measurement falls back to the estimate. DirectWrite can transiently report a zero-width layout mid-resize; believing it would collapse the banner to its padding. The menu bar already caches around the same transient.

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.

…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.
@relmer
relmer merged commit 17e175d into master Aug 21, 2026
6 checks passed
@relmer
relmer deleted the ci/banner-measured-height branch August 21, 2026 02:06
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.

1 participant