Sha256: 35d53dbd4ac1025a9700bf1eca2b0a32407f992f5db54e86022d47d8a0bd7e26

Contents?: true

Size: 1.36 KB

Versions: 28

Compression:

Stored size: 1.36 KB

Contents

package asunit.textui {
    import flash.display.DisplayObject;
    import flash.events.Event;
    import mx.core.IUIComponent;
    import asunit.textui.TestRunner;

    public class FlexTestRunner extends TestRunner {

		public function FlexTestRunner() {
			setPrinter(new ResultPrinter());
		}
	
		protected override function addedHandler(event:Event):void {
		    if(event.target === this) {
				parent.addEventListener(Event.RESIZE, resizeHandler);
				resizeHandler(new Event(Event.RESIZE));
		    }
		    else {
				event.stopPropagation();
			}
		}
	
		public override function set width(w:Number):void {
		    fPrinter.width = w;
		}
	
		public override function set height(h:Number):void {
		    fPrinter.height = h;
		}
	
		public function resizeHandler(event:Event):void {
		    width = parent.width;
		    height = parent.height;
		}
	
		public override function addChild(child:DisplayObject):DisplayObject {
		    if(parent && child is IUIComponent) {
				// AND check for 'is' UIUComponent...
				return parent.addChild(child);
		    }
		    else {
				return super.addChild(child);
		    }
		}
	
		public override function removeChild(child:DisplayObject):DisplayObject {
		    if(child is IUIComponent) {
				return parent.removeChild(child);
		    }
		    else {
				return super.removeChild(child);
		    }
		}
    }
}

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
asproject-0.1.27 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.29 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.30 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.21 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.28 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.31 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.35 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.34 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.37 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.32 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.33 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.36 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.38 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.41 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.43 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.44 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.42 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.40 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.60 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as
asproject-0.1.68 templates/asproject/asunit3/project/lib/asunit/asunit/textui/FlexTestRunner.as