Skip to content

Lay out the window through the test backend - #2012

Open
jordanmontt wants to merge 1 commit into
pharo-spec:Pharo15from
jordanmontt:backend-independent-layout-in-box-tests
Open

jordanmontt wants to merge 1 commit into
pharo-spec:Pharo15from
jordanmontt:backend-independent-layout-in-box-tests

Conversation

@jordanmontt

Copy link
Copy Markdown
Contributor

The box layout tests added in #2007 now run on every backend, not only Morphic: they no longer reach into Morphic's widgets, and ask the test backend to lay out the window instead.

With Spec-Toplo (its LabelWrap branch, pharo-graphics/Spec-Toplo#167), the three wrapping label tests now reach their checks and stop on SpToploLabelAdapter>>#numberOfLines, which Spec-Toplo does not implement yet. On Morphic, the box layout tests pass.

Goal

SpVerticalBoxLayoutAdapterTest>>#layOutWindow sent Morphic's #fullBounds to the window's widget. These tests are in the backend tests, so on another backend they failed before checking anything: with Spec-Toplo, BlSpace does not understand #fullBounds.

  • SpAbstractBackendForTest>>#layOutWindowOf: lays out the window of a test, as the UI would.

Main changes

  • By default, #layOutWindowOf: waits until the UI is redrawn (#waitUntilUIRedrawed); Spec-Toplo settles the spaces of its windows there.
  • SpMorphicBackendForTest lays out twice around a UI cycle, as the helper did: when the width of a wrapping label changes, its height may change too, and it asks its owner to lay out again in the next cycle. Only #waitUntilUIRedrawed is not enough on Morphic: two of the tests then fail.
  • #layOutWindow asks the backend.

🤖 Generated with Claude Code but reviewed thoroughly by jordanmontt ❤️

SpVerticalBoxLayoutAdapterTest>>#layOutWindow sent Morphic's #fullBounds to the window's widget, so its tests failed on other backends before checking anything. The test backends now lay out a window with #layOutWindowOf:: by default it waits until the UI is redrawn, and the Morphic backend lays out twice around a UI cycle, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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