// Event_as.hx:  ActionScript 3 "Event" class, for Gnash.
//
// Generated by gen-as3.sh on: 20090515 by "rob". Remove this
// after any hand editing loosing changes.
//
//   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
//

// This test case must be processed by CPP before compiling to include the
//  DejaGnu.hx header file for the testing framework support.

#if flash9
import flash.events.Event;
import flash.display.MovieClip;
#end
import flash.Lib;
import Type;
import Std;

// import our testing API
import DejaGnu;

// Class must be named with the _as suffix, as that's the same name as the file.
class Event_as {
    static function main() {
        #if !flash9
			DejaGnu.note("this class did not exist in as2");
		#end
		
		#if flash9
		var x1:Event = new Event("event");

        // Make sure we actually get a valid class        
        if (x1 != null) {
            DejaGnu.pass("Event class exists");
        } else {
            DejaGnu.fail("Event class doesn't exist");
        }
// Tests to see if all the properties exist. All these do is test for
// existance of a property, and don't test the functionality at all. This
// is primarily useful only to test completeness of the API implementation.
	if (Std.is(x1.bubbles, Bool)) {
	    DejaGnu.pass("Event.bubbles property exists");
	} else {
	    DejaGnu.fail("Event.bubbles property doesn't exist");
	}
	if (Std.is(x1.cancelable, Bool)) {
	    DejaGnu.pass("Event.cancelable property exists");
	} else {
	    DejaGnu.fail("Event.cancelable property doesn't exist");
	}
	if (Type.typeof(x1.currentTarget) == ValueType.TObject) {
	    DejaGnu.pass("Event.currentTarget property exists");
	} else {
	    DejaGnu.xfail("Event.currentTarget property doesn't exist");
	}
	if (Std.is(x1.eventPhase, Float)) {
	    DejaGnu.pass("Event.eventPhase property exists");
	} else {
	    DejaGnu.fail("Event.eventPhase property doesn't exist");
	}
	if (Type.typeof(x1.target) == ValueType.TObject) {
	    DejaGnu.pass("Event.target property exists");
	} else {
	    DejaGnu.xfail("Event.target property doesn't exist");
	}
	if (Std.is(x1.type, String)) {
	    DejaGnu.pass("Event.type property exists");
	} else {
	    DejaGnu.fail("Event.type property doesn't exist");
	}

// Tests to see if all the methods exist. All these do is test for
// existance of a method, and don't test the functionality at all. This
// is primarily useful only to test completeness of the API implementation.
	if (Type.typeof(x1.clone) == ValueType.TFunction) {
	    DejaGnu.pass("Event::clone() method exists");
	} else {
	    DejaGnu.fail("Event::clone() method doesn't exist");
	}
	if (Type.typeof(x1.formatToString) == ValueType.TFunction) {
	    DejaGnu.pass("Event::formatToString() method exists");
	} else {
	    DejaGnu.fail("Event::formatToString() method doesn't exist");
	}
	if (Type.typeof(x1.isDefaultPrevented) == ValueType.TFunction) {
	    DejaGnu.pass("Event::isDefaultPrevented() method exists");
	} else {
	    DejaGnu.fail("Event::isDefaultPrevented() method doesn't exist");
	}
	if (Type.typeof(x1.preventDefault) == ValueType.TFunction) {
	    DejaGnu.pass("Event::preventDefault() method exists");
	} else {
	    DejaGnu.fail("Event::preventDefault() method doesn't exist");
	}
	if (Type.typeof(x1.stopImmediatePropagation) == ValueType.TFunction) {
	    DejaGnu.pass("Event::stopImmediatePropagation() method exists");
	} else {
	    DejaGnu.fail("Event::stopImmediatePropagation() method doesn't exist");
	}
	if (Type.typeof(x1.stopPropagation) == ValueType.TFunction) {
	    DejaGnu.pass("Event::stopPropagation() method exists");
	} else {
	    DejaGnu.fail("Event::stopPropagation() method doesn't exist");
	}
	if (Type.typeof(x1.toString) == ValueType.TFunction) {
	    DejaGnu.pass("Event::toString() method exists");
	} else {
	    DejaGnu.fail("Event::toString() method doesn't exist");
	}
	
	//check constants
	if (Std.string(flash.events.Event.ACTIVATE) == "activate") {
		DejaGnu.pass("Event::ACTIVATE constant returns the correct string");
	} else {
		DejaGnu.fail("Event::ACTIVATE constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.ADDED) == "added") {
		DejaGnu.pass("Event::ADDED  constant returns the correct string");
	} else {
		DejaGnu.fail("Event::ADDED  constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.ADDED_TO_STAGE) == "addedToStage") {
		DejaGnu.pass("Event::  constant returns the correct string");
	} else {
		DejaGnu.fail("Event::  constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.CANCEL) == "cancel") {
		DejaGnu.pass("Event::CANCEL constant returns the correct string");
	} else {
		DejaGnu.fail("Event::CANCEL constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.CHANGE) == "change") {
		DejaGnu.pass("Event::CHANGE constant returns the correct string");
	} else {
		DejaGnu.fail("Event::CHANGE constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.CLOSE) == "close") {
		DejaGnu.pass("Event::  constant returns the correct string");
	} else {
		DejaGnu.fail("Event::  constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.CONNECT) == "connect") {
		DejaGnu.pass("Event::CONNECT constant returns the correct string");
	} else {
		DejaGnu.fail("Event::CONNECT constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.COMPLETE) == "complete") {
		DejaGnu.pass("Event::COMPLETE constant returns the correct string");
	} else {
		DejaGnu.fail("Event::COMPLETE constant returns the wrong string");
	}
	//NOT IN HAXE
	//if (Std.string(flash.events.Event.COPY) == "copy") {
	//	DejaGnu.pass("Event::COPY constant returns the correct string");
	//} else {
	//	DejaGnu.fail("Event::COPY constant returns the wrong string");
	//}
	//NOT IN HAXE
	//if (Std.string(flash.events.Event.CUT) == "cut") {
	//	DejaGnu.pass("Event::CUT constant returns the correct string");
	//} else {
	//	DejaGnu.fail("Event::CUT constant returns the wrong string");
	//}
	if (Std.string(flash.events.Event.DEACTIVATE) == "deactivate") {
		DejaGnu.pass("Event::DEACTIVATE constant returns the correct string");
	} else {
		DejaGnu.fail("Event::DEACTIVATE constant returns the wrong string");
	}
	//NOT IN HAXE
	//if (Std.string(flash.events.Event.DISPLAYING) == "displaying") {
	//	DejaGnu.pass("Event::DISPLAYING constant returns the correct string");
	//} else {
	//	DejaGnu.fail("Event::DISPLAYING constant returns the wrong string");
	//}
	//if (Std.string(flash.events.Event.ENTER_FRAME) == "enterFrame") {
	//	DejaGnu.pass("Event::ENTER_FRAME constant returns the correct string");
	//} else {
	//	DejaGnu.fail("Event::ENTER_FRAME constant returns the wrong string");
	//}
	//NOT IN HAXE
	//if (Std.string(flash.events.Event.EXIT_FRAME) == "exitFrame") {
	//	DejaGnu.pass("Event::EXIT_FRAME constant returns the correct string");
	//} else {
	//	DejaGnu.fail("Event::EXIT_FRAME constant returns the wrong string");
	//}
	//NOT IN HAXE
	//if (Std.string(flash.events.Event.FRAME_CONSTRUCTED) == "exitFrame") {
	//	DejaGnu.pass("Event::EXIT_FRAME constant returns the correct string");
	//} else {
	//	DejaGnu.fail("Event::EXIT_FRAME constant returns the wrong string");
	//}
	if (Std.string(flash.events.Event.FULLSCREEN) == "fullScreen") {
		DejaGnu.pass("Event::FULLSCREEN constant returns the correct string");
	} else {
		DejaGnu.fail("Event::FULLSCREEN constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.ID3) == "id3") {
		DejaGnu.pass("Event::ID3 constant returns the correct string");
	} else {
		DejaGnu.fail("Event::ID3 constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.INIT) == "init") {
		DejaGnu.pass("Event::INIT constant returns the correct string");
	} else {
		DejaGnu.fail("Event::INIT constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.MOUSE_LEAVE) == "mouseLeave") {
		DejaGnu.pass("Event::MOUSELEAVE constant returns the correct string");
	} else {
		DejaGnu.fail("Event::MOUSELEAVE  constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.OPEN) == "open") {
		DejaGnu.pass("Event::OPEN constant returns the correct string");
	} else {
		DejaGnu.fail("Event::OPEN constant returns the wrong string");
	}
	//if (Std.string(flash.events.Event.PASTE) == "paste") {
	//	DejaGnu.pass("Event::PASTE constant returns the correct string");
	//} else {
	//	DejaGnu.fail("Event::PASTE constant returns the wrong string");
	//}
	if (Std.string(flash.events.Event.REMOVED) == "removed") {
		DejaGnu.pass("Event::REMOVED constant returns the correct string");
	} else {
		DejaGnu.fail("Event::REMOVED constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.REMOVED_FROM_STAGE) == "removedFromStage") {
		DejaGnu.pass("Event::REMOVEDFROMSTAGE constant returns the correct string");
	} else {
		DejaGnu.fail("Event::REMOVEDFROMSTAGE constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.RENDER) == "render") {
		DejaGnu.pass("Event::RENDER constant returns the correct string");
	} else {
		DejaGnu.fail("Event::RENDER constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.RESIZE) == "resize") {
		DejaGnu.pass("Event::RESIZE  constant returns the correct string");
	} else {
		DejaGnu.fail("Event::RESIZE  constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.SCROLL) == "scroll") {
		DejaGnu.pass("Event::SCROLL  constant returns the correct string");
	} else {
		DejaGnu.fail("Event::SCROLL  constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.SELECT) == "select") {
		DejaGnu.pass("Event::SELECT constant returns the correct string");
	} else {
		DejaGnu.fail("Event::SELECT constant returns the wrong string");
	}
	//NOT IN HAXE
	//if (Std.string(flash.events.Event.SELECT_ALL) == "selectAll") {
	//	DejaGnu.pass("Event::SELECTALL constant returns the correct string");
	//} else {
	//	DejaGnu.fail("Event::SELECTALL constant returns the wrong string");
	//}
	if (Std.string(flash.events.Event.SOUND_COMPLETE) == "soundComplete") {
		DejaGnu.pass("Event::SOUNDCOMPLETE  constant returns the correct string");
	} else {
		DejaGnu.fail("Event::SOUNDCOMPLETE  constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.TAB_CHILDREN_CHANGE) == "tabChildrenChange") {
		DejaGnu.pass("Event::TABCHILDRENCHANGE constant returns the correct string");
	} else {
		DejaGnu.fail("Event::TABCHILDRENCHANGE constant returns the wrong string");
	}
	//NOT IN HAXE
	//if (Std.string(flash.events.Event.TAB_ENBABLED_CHANGE) == "tabEnabledChange") {
	//	DejaGnu.pass("Event::TABENABLEDCHANGE constant returns the correct string");
	//} else {
	//	DejaGnu.fail("Event::TABENABLEDCHANGE constant returns the wrong string");
	//}
	if (Std.string(flash.events.Event.TAB_INDEX_CHANGE) == "tabIndexChange") {
		DejaGnu.pass("Event::TABINDEXCHANGE constant returns the correct string");
	} else {
		DejaGnu.fail("Event::TABINDEXCHANGE constant returns the wrong string");
	}
	if (Std.string(flash.events.Event.UNLOAD) == "unload") {
		DejaGnu.pass("Event::UNLOAD constant returns the correct string");
	} else {
		DejaGnu.fail("Event::UNLOAD constant returns the wrong string");
	}
	#end
        // Call this after finishing all tests. It prints out the totals.
        DejaGnu.done();
    }
}

// local Variables:
// mode: C++
// indent-tabs-mode: t
// End:

