FlexUnit nested async tests

Posted by sharvey on Stack Overflow See other posts from Stack Overflow or by sharvey
Published on 2010-03-29T15:28:31Z Indexed on 2010/03/29 15:33 UTC
Read the original article Hit count: 542

Filed under:
|
|

I'm trying to test some async functionality in flex 4. My test has two stages :

var loader:MySuperLoader = new MySuperLoader()
loader.load('foo.swf');
loader.addEventListener(Event.COMPLETE, Async.asyncHandler(this, function(e:Event):void {
    loader.removeEventListener(Event.COMPLETE, arguments.callee);
    var foo:* = loader.content;
    loader.load('bar.swf');
    loader.addEventListener(Event.COMPLETE, Async.asyncHandler(this, function(e:Event):void { 
        /* This call to asyncHandler generates the error */ 
    }, 5000));
}, 5000));

The second call to asyncHandler generates an error saying :

Error: Cannot add asynchronous functionality to methods defined by Test,Before or After that are not marked async

Is there a way to test such funcitonality?

© Stack Overflow or respective owner

Related posts about flexunit

Related posts about flex4