出於某種原因,在我嘗試執行操作時,如this article中所述,在flexunit測試中添加同步鏈接完全失敗。flexunit addAsync鏈接
public function testWhatever():void {
var cont:EventDispatcher = new EventDispatcher();
cont.addEventListener("continue", addAsync(verifyFirst, 1000));
cont.dispatchEvent(new Event("continue"));
}
private function verifyFirst(e:Event):void {
var cont:EventDispatcher = new EventDispatcher();
cont.addEventListener("continue", addAsync(verifySecond, 1000));
cont.dispatchEvent(new Event("continue"));
}
private function verifySecond(e:Event):void {
assertTrue(true);
}
如果我運行這個測試,verifyFirst會被調用,但verifySecond不會。我假設這是flexunit中的錯誤...是否有解決方法?