フレックスユニットでタイマーイベントをテストしています。以下は、私が試したコードです。常に cmdFailed 関数 (タイムアウト関数) に移動します。フレックス ユニットは初めてです。
[前]
public function setUp():void
{
timer = new Timer(12000);
}
[Test(async,order=1)]
public function teststorapidpresenter():void
{
timer.addEventListener(TimerEvent.TIMER_COMPLETE,Async.asyncHandler(this,cmdHandler,20000,null,cmdFailed));
timer.start();
}
private function cmdHandler(event:TimerEvent,passThroughData:Object):void
{
}
private function cmdFailed(event:Event):void
{
fail("Event not dispatched");
}