ok I can't do it, so I copy it here
public class TestSWFLoader {
protected var swfloader:SWFLoader;
[Before(async,ui)]
public function setUp():void {
swfloader = new SWFLoader();
Async.proceedOnEvent( this, swfloader, FlexEvent.CREATION_COMPLETE, 100 );
UIImpersonator.addChild( swfloader );
}
[After(async,ui)]
public function tearDown():void {
swfloader.unloadAndStop();
UIImpersonator.removeChild( swfloader );
swfloader = null;
}
[Test(async,ui)]
public function testLoad() : void {
swfloader.addEventListener(Event.COMPLETE, Async.asyncHandler( this, onLoadComplete, 500 ), false, 0, true );
var loaderctx : LoaderContext = new LoaderContext();
loaderctx.applicationDomain = new ApplicationDomain();
//loaderctx.applicationDomain = ApplicationDomain.currentDomain;
swfloader.loaderContext = loaderctx;
swfloader.load('resources/Example.swf');
}
protected function onLoadComplete( event:Event, passThroughData:Object )
{
Assert.assertEquals(swfloader.source, 'resources/Example.swf');
}
}
Okay, I can replicate this.
Having seen it, I can also now replicate it out of the FlexUnit framework though. Seems like this the specific issue with the FU framework is when we add it to the UIImpersonator container, the bridgeToFocus manager is never properly created internally.
I can create the same circumstance in a regular application too if I follow a similar pattern. Willing to look into this more but might need to loop in some others so I don't think it will be a quick fix.
When you have time, please file this as a bug in the FlexUnit jira. Adobe is off this week, so it will be at least next week before I can get an opinion on some of my proposed fixes.
Mike