Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Spec2-Backend-Tests/SpAbstractBackendForTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ SpAbstractBackendForTest >> emulateClick: mouseButtonCode onTest: anAdapterTest
self waitUntilUIRedrawed
]

{ #category : 'testing' }
SpAbstractBackendForTest >> layOutWindowOf: aTest [
"Hook. I lay out the window of aTest, as the UI would, so that its widgets have their final bounds."

self waitUntilUIRedrawed
]

{ #category : 'testing' }
SpAbstractBackendForTest >> waitUntilUIRedrawed [
"Hook. I wait until the UI has been redrawn and events have been handled."
Expand Down
9 changes: 9 additions & 0 deletions src/Spec2-Backend-Tests/SpMorphicBackendForTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ SpMorphicBackendForTest >> initialize [
self initializeSemaphore
]

{ #category : 'testing' }
SpMorphicBackendForTest >> layOutWindowOf: aTest [
"Twice: 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 UI cycle."

aTest window adapter widget fullBounds.
self waitUntilUIRedrawed.
aTest window adapter widget fullBounds
]

{ #category : 'opening' }
SpMorphicBackendForTest >> openInstanceOf: aTest [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ Class {

{ #category : 'helpers' }
SpVerticalBoxLayoutAdapterTest >> layOutWindow [
"We need to lay out twice. As this is a wrapping morph, when the width changes, the height may change too (because of the wrapping, narrowing it can make it larger). We need to lay out twice to apply the changes to the height, too."

self window adapter widget fullBounds.
"a wrapping label whose height changed asks its owner to lay out again, in the next UI cycle"
self adapter.
self window adapter widget fullBounds
backendForTest layOutWindowOf: self
]

{ #category : 'accessing' }
Expand Down
Loading