Using validateNow to test UIComponents
I've been using validateNow() in my test setup methods to force UIComponents to finish their creationComplete handling before a new test actually runs. This works most of the time, but I've had some wierd errors occassionally, and I've tracked them down to cases where the object is not fully initalized after validateNow returns.
Are there cases where validateNow() will defer execution of the usual commitProperties/measure/updateDisplayList sequence?
The happy path (which is 99% of the time) looks like:
setUp() -> calls validateNow() -> calls obj.creationComplete
test method runs
tearDown -> calls removeChild() and validateNow
But when the problem happens, the execution order is
setUp() -> calls validateNow()
test method runs
tearDown -> calls removeChild() and validateNow()
obj.creationComplete fires and crashes
One of the really nasty parts here is that the exception is thrown outside of the execution of the test method, which means when this problem
happens in an unattended nightly build process, the debug Flash player hosting the test SWF throws up an exception dialog and the entire test
harness hangs until some build timeout expires to kill the process.
