Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
138 additions
and
75 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Class { | ||
#name : #BlHostPulseLoopTest, | ||
#superclass : #BlParameterizedHostTest, | ||
#category : #'Bloc-Tests-Space' | ||
} | ||
|
||
{ #category : #running } | ||
BlHostPulseLoopTest >> runCaseManaged [ | ||
|
||
^ self runCase | ||
] | ||
|
||
{ #category : #tests } | ||
BlHostPulseLoopTest >> testOpeningAnSpaceDeferingAnErrorKeepsLoopRunning [ | ||
|
||
| aSpace logger | | ||
|
||
UIManager default class = MorphicUIManager | ||
ifFalse: [ ^ self skip ]. | ||
|
||
hostClass = BlOSWindowSDL2Host | ||
ifFalse: [ ^ self skip ]. | ||
|
||
aSpace := self newTestingSpace. | ||
aSpace root addChild: (BlElement new background: Color blue; yourself). | ||
|
||
aSpace show. | ||
|
||
logger := MemoryLogger new. | ||
logger runFor: BlParallelUniverseErrorDuringPulse during: [ | ||
aSpace universe defer: [ 1 error: 'I am the debugger to kill' ]. | ||
[aSpace universe hasDeferredActions] whileTrue: [ | ||
100 milliSeconds wait | ||
]]. | ||
|
||
self assert: logger recordings size equals: 2. | ||
self assert: logger recordings first signaledError class equals: Error. | ||
self assert: logger recordings second signaledError class equals: UnhandledError. | ||
|
||
MorphicRenderLoop new doOneCycle. | ||
|
||
"This is horrible, I will fix Pharo to have a list of open debuggers" | ||
StDebugger allInstances | ||
detect: [ :e | e window title = 'Error: I am the debugger to kill' ] | ||
ifFound: [ :x | x window close ] | ||
ifNone: [ self fail ]. | ||
|
||
] |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
" | ||
I am a signal that is raised when there is an error in the pulse. | ||
I include in myself the signaledError. | ||
" | ||
Class { | ||
#name : #BlParallelUniverseErrorDuringPulse, | ||
#superclass : #BlParallelUniverseSignal, | ||
#instVars : [ | ||
'signaledError' | ||
], | ||
#category : #'Bloc-Universe - Parallel' | ||
} | ||
|
||
{ #category : #accessing } | ||
BlParallelUniverseErrorDuringPulse >> signaledError [ | ||
|
||
^ signaledError | ||
] | ||
|
||
{ #category : #accessing } | ||
BlParallelUniverseErrorDuringPulse >> signaledError: anObject [ | ||
|
||
signaledError := anObject | ||
] |
This file contains 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
This file contains 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