UI testing: wait until event queue empties
...when `#do:`ing an user action. This is necessary
for widget/tools that pushes more work back onto an even
queue (in order to make the system more responsive).
--- a/ext/ui/SimpleViewInteractor.st Wed Jul 12 09:59:48 2017 +0200
+++ b/ext/ui/SimpleViewInteractor.st Sun Nov 26 20:40:34 2017 +0000
@@ -82,6 +82,17 @@
self error: 'User action did not finish in ', timeout printString , 'ms'.
].
+ "/ A thus point, `aBlock` has processed by the event queue. Now we have to
+ "/ wait for event queue to empty - some widget/tools just delay the actual action
+ "/ by pushing the real work back into queue. Following makes sure those delayed
+ "/ actions are processed too.
+ blocker1 := Semaphore new.
+ view sensor pushAction:[
+ blocker1 signal.
+ ].
+ blocker1 wait.
+
+
"Created: / 31-01-2015 / 08:27:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 18-07-2016 / 18:56:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!