// Capabilities_as3.hx:  ActionScript 3 "Capabilities" class, for Gnash.
//
// Generated by gen-as3.sh on: 20090514 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.system.Capabilities;
import flash.display.MovieClip;
#else
//import flash.Capabilities;
//import flash.MovieClip;
#end
import flash.Lib;
import Type;
import Std;

// import our testing API
import DejaGnu;

// Class must be named with the _as3 suffix, as that's the same name as the file.
class Capabilities_as {
    static function main() {
        // Make sure we actually get a valid class
#if flash9
//Si:
//Check the Capabilities        
	if (Type.typeof(Capabilities) == TObject ) {	      
            DejaGnu.pass("Capabilities class exists");
        } else {
            DejaGnu.fail("Capabilities 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.

//Si:
//Check the properties:
	
//	DejaGnu.note("ME1 " + Type.typeof(Capabilities._internal) );
//	DejaGnu.note("ME2 " + Type.typeof(Capabilities.screenDPI) );
//	Capabilities._internal=0;


//Si:
//I do not know how to check the UInt!
//This check is ignored right now!
/*
	if (Std.is(Capabilities._internal,UInt) ) { 
	    DejaGnu.pass("Capabilities._internal property exists");
	} else {
	    DejaGnu.fail("Capabilities._internal property doesn't exist");
	}
*/

	if (Type.typeof(Capabilities.avHardwareDisable) == TBool) {
	    DejaGnu.pass("Capabilities.avHardwareDisable property exists");
	} else {
	    DejaGnu.fail("Capabilities.avHardwareDisable property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasAccessibility) == TBool) {
	    DejaGnu.pass("Capabilities.hasAccessibility property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasAccessibility property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasAudio) == TBool) {
	    DejaGnu.pass("Capabilities.hasAudio property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasAudio property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasAudioEncoder) == TBool) {
	    DejaGnu.pass("Capabilities.hasAudioEncoder property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasAudioEncoder property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasEmbeddedVideo ) == TBool) {
	    DejaGnu.pass("Capabilities.hasEmbeddedVideo property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasEmbeddedVideo property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasIME ) == TBool) {
	    DejaGnu.pass("Capabilities.hasIME property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasIME property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasMP3) == TBool) {
	    DejaGnu.pass("Capabilities.hasMP3 property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasMP3 property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasPrinting ) == TBool) {
	    DejaGnu.pass("Capabilities.hasPrinting property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasPrinting property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasScreenBroadcast) == TBool) {
	    DejaGnu.pass("Capabilities.hasScreenBroadcast property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasScreenBroadcast property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasScreenPlayback ) == TBool) {
	    DejaGnu.pass("Capabilities.hasScreenPlayback property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasScreenPlayback property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasStreamingAudio ) == TBool) {
	    DejaGnu.pass("Capabilities.hasStreamingAudio property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasStreamingAudio property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasStreamingVideo) == TBool) {
	    DejaGnu.pass("Capabilities.hasStreamingVideo property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasStreamingVideo property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasTLS) == TBool) {
	    DejaGnu.pass("Capabilities.hasTLS property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasTLS property doesn't exist");
	}
	if (Type.typeof(Capabilities.hasVideoEncoder) == TBool) {
	    DejaGnu.pass("Capabilities.hasVideoEncoder property exists");
	} else {
	    DejaGnu.fail("Capabilities.hasVideoEncoder property doesn't exist");
	}
	if (Type.typeof(Capabilities.isDebugger) == TBool) {
	    DejaGnu.pass("Capabilities.isDebugger property exists");
	} else {
	    DejaGnu.fail("Capabilities.isDebugger property doesn't exist");
	}

//Si:
//Not defined in haxe:
// 	if (Capabilities.isEmbeddedInAcrobat == false) {
// 	    DejaGnu.pass("Capabilities.isEmbeddedInAcrobat property exists");
// 	} else {
// 	    DejaGnu.fail("Capabilities.isEmbeddedInAcrobat property doesn't exist");
// 	}
	if (Std.is(Capabilities.language,String) ) {
	    DejaGnu.pass("Capabilities.language property exists");
	} else {
	    DejaGnu.fail("Capabilities.language property doesn't exist");
	}

// AIR only
// 	if (Capabilities.languages == 0) {
// 	    DejaGnu.pass("Capabilities.languages property exists");
// 	} else {
// 	    DejaGnu.fail("Capabilities.languages property doesn't exist");
// 	}

//Si:
//Keep check other files
	if (Type.typeof(Capabilities.localFileReadDisable )== TBool) {
	    DejaGnu.pass("Capabilities.localFileReadDisable property exists");
	} else {
	    DejaGnu.fail("Capabilities.localFileReadDisable property doesn't exist");
	}
	if (Std.is(Capabilities.manufacturer,String) ) {
	    DejaGnu.pass("Capabilities.manufacturer property exists");
	} else {
	    DejaGnu.fail("Capabilities.manufacturer property doesn't exist");
	}
	if (Std.is(Capabilities.os,String) ) {
	    DejaGnu.pass("Capabilities.os property exists");
	} else {
	    DejaGnu.fail("Capabilities.os property doesn't exist");
	}
	if (Std.is(Capabilities.pixelAspectRatio, Float) ) {
	    DejaGnu.pass("Capabilities.pixelAspectRatio property exists");
	} else {
	    DejaGnu.fail("Capabilities.pixelAspectRatio property doesn't exist");
	}
	if (Std.is(Capabilities.playerType,String) ) {
	    DejaGnu.pass("Capabilities.playerType property exists");
	} else {
	    DejaGnu.fail("Capabilities.playerType property doesn't exist");
	}
	if (Std.is(Capabilities.screenColor, String) ) {
	    DejaGnu.pass("Capabilities.screenColor property exists");
	} else {
	    DejaGnu.fail("Capabilities.screenColor property doesn't exist");
	}
	if ( Std.is(Capabilities.screenDPI,Float) ) {
	    DejaGnu.pass("Capabilities.screenDPI property exists");
	} else {
	    DejaGnu.fail("Capabilities.screenDPI property doesn't exist");
	}
	if ( Std.is(Capabilities.screenResolutionX,Float) ) {
	    DejaGnu.pass("Capabilities.screenResolutionX property exists");
	} else {
	    DejaGnu.fail("Capabilities.screenResolutionX property doesn't exist");
	}
	if ( Std.is(Capabilities.screenResolutionY, Float) ) {
	    DejaGnu.pass("Capabilities.screenResolutionY property exists");
	} else {
	    DejaGnu.fail("Capabilities.screenResolutionY property doesn't exist");
	}
	if (Std.is( Capabilities.serverString,String) ) {
	    DejaGnu.pass("Capabilities.serverString property exists");
	} else {
	    DejaGnu.fail("Capabilities.serverString property doesn't exist");
	}
	if (Std.is(Capabilities.version,String) ) {
	    DejaGnu.pass("Capabilities.version property exists");
	} else {
	    DejaGnu.fail("Capabilities.version property doesn't exist");
	}

        // Call this after finishing all tests. It prints out the totals.

        DejaGnu.done();
#else
#end
    }
}

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

