// System_as3.hx:  ActionScript 3 "System" 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.System;
import flash.display.MovieClip;
#else
import flash.System;
import flash.MovieClip;
#end
import flash.Lib;
import Type;
import Reflect;
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 System_as {

    static function main() {
	if (Type.typeof(System) == ValueType.TObject) {
	    DejaGnu.pass("System class exists");
	} else {
	    DejaGnu.fail("System 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 (System.ime == ime) {
// 	    DejaGnu.pass("System.ime property exists");
// 	} else {
// 	    DejaGnu.fail("System.ime property doesn't exist");
// 	}
/*
#if flash9
	DejaGnu.note("Warning! Type of exit "   + Type.typeof(System.exit));
        DejaGnu.note("Warning! Type of gc "   + Type.typeof(System.gc) );
      	DejaGnu.note("Warning! Type of pause "   + Type.typeof(System.pause) );
	DejaGnu.note("Warning! Type of resume" + Type.typeof(System.resume) );
	DejaGnu.note("Warning! type of setClipboard "   + Type.typeof(System.setClipboard));
#end
*/
//Test System.totalMemory
#if flash9
	if (Type.typeof(System.totalMemory) == ValueType.TInt) {
	    DejaGnu.pass("System.totalMemory property exists");
	} else {
	    DejaGnu.fail("System.totalMemory property doesn't exist");
	}
#end	


// Test of useCodePage or useCodepage
#if flash9
	if (Type.typeof(System.useCodePage) == ValueType.TBool) {
	    DejaGnu.pass("System.useCodePage property exists");
	} else {
	    DejaGnu.fail("System.useCodePage property doesn't exist");
	}
#else
	if (Type.typeof(System.useCodepage) == ValueType.TBool) {
	    DejaGnu.pass("System.useCodePage property exists");
	} else {
	    DejaGnu.fail("System.useCodePage property doesn't exist");
	}
#end

	if (Type.typeof(System.setClipboard) == TFunction) {
	    DejaGnu.pass("System::setClipboard() method exists");
	} else {
	    DejaGnu.fail("System::setClipboard() method 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

// Si: I am not sure if these four functions are well defined!!!!!!
// They are claimed. 
// They may never be implemented!

//Si
//These functions have not been implemented yet!

#if flash9
	DejaGnu.note("Warning! exit(), gc(), pause(), and resume() have not been implemented yet!");
	if (System.exit == null) {
	    DejaGnu.pass("System::exit() method exists");
	} else {
	    DejaGnu.fail("System::exit() method doesn't exist");
	}
	if (System.gc == null) {
	    DejaGnu.pass("System::gc() method exists");
	} else {
	    DejaGnu.fail("System::gc() method doesn't exist");
	}
	if (System.pause == null) {
	    DejaGnu.pass("System::pause() method exists");
	} else {
	    DejaGnu.fail("System::pause() method doesn't exist");
	}
	if (System.resume == null) {
	    DejaGnu.pass("System::resume() method exists");
	} else {
	    DejaGnu.fail("System::resume() method doesn't exist");
	}

#end

#if flash9
#else
	if (Type.typeof(System.exactSettings) == ValueType.TBool) {
	    DejaGnu.pass("System.exactSettings property exists");
	} else {
	    DejaGnu.fail("System.exactSettings property doesn't exist");
	}
	
	if (Type.typeof(System.showSettings) == ValueType.TFunction) {
	    DejaGnu.pass("System::showSettings() method exists");
	} else {
	    DejaGnu.fail("System::showSettings() method doesn't exist");
	}
//Si:
//onStatus is a dynamic function only used in the old version!
//The return type is TNULL 
//It should exist!

	if (Type.typeof(System.onStatus) == ValueType.TNull) {
	    DejaGnu.pass("System::onStatus() method exists");
	} else {
	    DejaGnu.fail("System::onStatus() method doesn't exist");
	}
	if (Std.is(System.onStatus, Dynamic)) {
	    DejaGnu.pass("System::onStatus() method exists (Dynamic)");
	} else {
	    DejaGnu.fail("System::onStatus() method doesn't exist (Danamic)");
	}
#end

// Si:
// Add the following Ming test 
// June 9 and 10, 2009

DejaGnu.note("\n The following tests come from the Ming test. \n Some of the tests may be  duplicated !\n" );

#if flash9
//Si
//The following capabilities.hasOwnProperty tests are not implemented in flash 9!
// capabilities is now derived from object directly.
	DejaGnu.note("Warning! Capabilities is now derived from object directly!");
#else
if (untyped System.capabilities.hasOwnProperty("version")){
	DejaGnu.pass("System.capabilities 'version' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'version' property does not exist");
	}
	if (untyped System.capabilities.hasOwnProperty("os")){
	DejaGnu.pass("System.capabilities 'os' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'os' property does not exist");
	}	
if (untyped System.capabilities.hasOwnProperty("manufacturer")){
	DejaGnu.pass("System.capabilities 'manufacturer' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'manufacturer' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("playerType")){
	DejaGnu.pass("System.capabilities 'playerType' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'playerType' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("serverString")){
	DejaGnu.pass("System.capabilities 'serverString' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'serverString' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("screenResolutionX")){
	DejaGnu.pass("System.capabilities 'screenResolutionX' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'screenResolutionX' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("screenResolutionY")){
	DejaGnu.pass("System.capabilities 'screenResolutionY' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'screenResolutionY' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("screenDPI")){
	DejaGnu.pass("System.capabilities 'screenDPI' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'screenDPI' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("screenColor")){
	DejaGnu.pass("System.capabilities 'screenColor' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'screenColor' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("pixelAspectRatio")){
	DejaGnu.pass("System.capabilities 'pixelAspectRatio' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'pixelAspectRatio' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("localFileReadDisable")){
	DejaGnu.pass("System.capabilities 'localFileReadDisable' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'localFileReadDisable' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("language")){
	DejaGnu.pass("System.capabilities 'language' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'language' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("isDebugger")){
	DejaGnu.pass("System.capabilities 'isDebugger' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'isDebugger' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("hasVideoEncoder")){
	DejaGnu.pass("System.capabilities 'hasVideoEncoder' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'hasVideoEncoder' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("hasStreamingVideo")){
	DejaGnu.pass("System.capabilities 'hasStreamingVideo' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'hasStreamingVideo' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("hasStreamingAudio")){
	DejaGnu.pass("System.capabilities 'hasStreamingAudio' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'hasStreamingAudio' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("hasScreenPlayback")){
	DejaGnu.pass("System.capabilities 'hasScreenPlayback' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'hasScreenPlayback' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("hasScreenBroadcast") ){
	DejaGnu.pass("System.capabilities 'hasScreenBroadcast' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'hasScreenBroadcast' property does not exist");
	}	
if (untyped System.capabilities.hasOwnProperty("hasPrinting") ){
	DejaGnu.pass("System.capabilities 'hasPrinting' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'hasPrinting' property does not exist");
	}	
if (untyped System.capabilities.hasOwnProperty("hasMP3") ){
	DejaGnu.pass("System.capabilities 'hasMP3' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'hasMP3' property does not exist");
	}	
if (untyped System.capabilities.hasOwnProperty("hasEmbeddedVideo") ){
	DejaGnu.pass("System.capabilities 'hasEmbeddedVideo' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'hasEmbeddedVideo' property does not exist");
	}	
if (untyped System.capabilities.hasOwnProperty("hasAudioEncoder") ){
	DejaGnu.pass("System.capabilities 'hasAudioEncoder' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'hasAudioEncoder' property does not exist");
	}	
if (untyped System.capabilities.hasOwnProperty("hasAudio") ){
	DejaGnu.pass("System.capabilities 'hasAudio' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'hasAudio' property does not exist");
	}	
if (untyped System.capabilities.hasOwnProperty("hasAccessibility") ){
	DejaGnu.pass("System.capabilities 'hasAccessibility' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'hasAccessibility' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("avHardwareDisable") ){
	DejaGnu.pass("System.capabilities 'avHardwareDisable' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'avHardwareDisable' property does not exist");
	}
if (untyped System.capabilities.hasOwnProperty("windowlessDisable") ){
	DejaGnu.pass("System.capabilities 'windowlessDisable' property exists");
	} else {
		DejaGnu.fail("System.capabilities 'windowlessDisable' property does not exist");
	}
if (untyped System.hasOwnProperty("exactSettings") ){
	DejaGnu.pass("System 'exactSettings' property exists");
	} else {
		DejaGnu.fail("System 'exactSettings' property does not exist");
	}	
#end

#if flash9
#else
var systemObj = untyped __new__(System);
//DejaGnu.note("type of systemObj: " +Std.string(untyped __typeof__(systemObj)) );

if (Std.string(untyped __typeof__(systemObj)) == 'undefined') {
	DejaGnu.pass("Type of systemObj is undefined");
} else {
	DejaGnu.fail("Type of systemObj is not undefined");
}
#end

//Si	//Check te versions more carefully!
#if flash6
	//Do Nothing!
#else
//	DejaGnu.note("__proto__: " + Type.typeof(untyped System.__proto__));
#if flash9
#else
	if ( Reflect.isObject(untyped System.__proto__)) {
		DejaGnu.pass("System.prototype.__proto__ field exists");
	} else {
		DejaGnu.fail("System.prototype.__proto__ field does not exist");
	}
	if ( untyped System.__proto__ == untyped Object.prototype) {
		DejaGnu.pass("System.prototype.__proto__ references Object.prototype");
	} else {
		DejaGnu.fail("System.prototype.__proto__ does not reference Object.prototype");
	}
#end
#end

//	Si
//	System does not have a constructor
// 	I can not build a object to check other things!

#if flash9
//Si
//security, as well as capabilities, is now derived from object directly!
//These tests should be done in the security and capabilities class
#else
	if (Type.typeof(untyped System.security.allowDomain) == TFunction) {
	    DejaGnu.pass("System.security 'allowDomain()' method exists");
	} else {
	    DejaGnu.fail("System.security 'allowDomain()' method doesn't exist");
	}
	var result = untyped System.security.allowDomain("www.cnn.com");
	if (untyped __typeof__(result) == 'boolean') {
		DejaGnu.pass("allowDomain correctly returns a boolean");
	} else {
		DejaGnu.fail("allowDomain did not return a boolean");
	}
	if (untyped System.security.allowDomain("google.com")) {
		DejaGnu.pass("google.com successfully added to allowed domains");
	} else {
		DejaGnu.fail("google.com not successfully added to allowed domains");
	}
	

	if (Type.typeof(untyped System.security.loadPolicyFile) == TFunction) {
	    DejaGnu.pass("System.security 'loadPolicyFile()' method exists");
	} else {
	    DejaGnu.fail("System.security 'loadPolicyFile()' method doesn't exist");
	}
	if (Type.typeof(untyped System.showSettings) == TFunction) {
	    DejaGnu.pass("System.'showSettings()' method exists");
	} else {
	    DejaGnu.fail("System.'showSettings()' method doesn't exist");
	}
#end

	if (Type.typeof(untyped System.setClipboard) == TFunction) {
	    DejaGnu.pass("System.'setClipboard()' method exists");
	} else {
	    DejaGnu.fail("System.'setClipboard()' method doesn't exist");
	}

#if flash6
#else 
#if flash9
#else
	if ( Type.typeof(untyped System.security.allowInsecureDomain) == TFunction ){
	    DejaGnu.pass("System.security 'allowInsecureDomain()' method exists");
	} else {
	    DejaGnu.fail("System.security 'allowInsecureDomain()' method doesn't exist");
	}
//	DejaGnu.note("system.capabilities type: " + Type.typeof(untyped System.capabilities));
	if (Type.typeof(untyped System.capabilities) ==TObject){
	    DejaGnu.pass("System capabilities exists");
	} else {
	    DejaGnu.fail("System capabilities doesn't exist");
	}
#end
#end	

//	DejaGnu.note("system.capabilities type: " + Type.typeof(untyped System.capabilities.version));

#if flash9
#else    
    if (Std.is(untyped System.capabilities.version, String)){
	    DejaGnu.pass("System.capabilities.version is a string ");
	} else {
	    DejaGnu.fail("System.capabilities.version is not a string");
	}
  	if (Std.is(untyped System.capabilities.os, String)){
	    DejaGnu.pass("System.capabilities.os is a string ");
	} else {
	    DejaGnu.fail("System.capabilities.os is not a string");
	}
	if (Std.is(untyped System.capabilities.manufacturer, String)){
	    DejaGnu.pass("System.capabilities.manufacturer is a string ");
	} else {
	    DejaGnu.fail("System.capabilities.manufacturer is not a string");
	}
	if (Std.is(untyped System.capabilities.playerType, String)){
	   DejaGnu.pass("System.capabilities.playerType is a string ");
	} else {
	    DejaGnu.fail("System.capabilities.playerType is not a string");
	}
	if (Std.is(untyped System.capabilities.serverString, String)){
	   DejaGnu.pass("System.capabilities.serverString is a string ");
	} else {
	    DejaGnu.fail("System.capabilities.serverString is not a string");
	}
	if (Std.is(untyped System.capabilities.screenColor, String)){
	   DejaGnu.pass("System.capabilities.screenColor is a string ");
	} else {
	    DejaGnu.fail("System.capabilities.screenColor is not a string");
	}

	if (Std.is(untyped System.capabilities.pixelAspectRatio, String)){
	   DejaGnu.pass("System.capabilities.pixelAspectRatio is a string ");
	} else {
	    DejaGnu.fail("System.capabilities.pixelAspectRatio is not a string");
	}
	if (Std.is(untyped System.capabilities.language, String)){
	   DejaGnu.pass("System.capabilities.language is a string ");
	} else {
	    DejaGnu.fail("System.capabilities.language is not a string");
	}
	if (Std.is(untyped System.capabilities.screenResolutionX,Float)){
	   DejaGnu.pass("System.capabilities.screenResolutionX is a number");
	} else {
	    DejaGnu.fail("System.capabilities.scrennResolutionX is not a number");
	}
	if (Std.is(untyped System.capabilities.screenResolutionY,Float)){
	   DejaGnu.pass("System.capabilities.screenResolutionY is a number");
	} else {
	    DejaGnu.fail("System.capabilities.scrennResolutionY is not a number");
	}
	if (Std.is(untyped System.capabilities.screenDPI,Float)){
	   DejaGnu.pass("System.capabilities.screenDPI is a number");
	} else {
	    DejaGnu.fail("System.capabilities.scrennDPI is not a number");
	}
	if (Std.is(untyped System.capabilities.localFileReadDisable, Bool) ){
	  DejaGnu.pass("System.capabilities.localFileReadDisable is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.localFileReadDisable is not a bool");
	}

	if (Std.is(untyped System.capabilities.localFileReadDisable, Bool) ){
	  DejaGnu.pass("System.capabilities.localFileReadDisable is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.localFileReadDisable is not a bool");
	}
	if (Std.is(untyped System.capabilities.isDebugger, Bool) ){
	  DejaGnu.pass("System.capabilities.isDebugger is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.isDebugger is not a bool");
	}
	if (Std.is(untyped System.capabilities.hasVideoEncoder, Bool) ){
	  DejaGnu.pass("System.capabilities.hasVideoEncoder is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasVideoEncoder is not a bool");
	}
	if (Std.is(untyped System.capabilities.hasStreamingVideo, Bool) ){
	  DejaGnu.pass("System.capabilities.hasStreamingVideo is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasStreamingVideo is not a bool");
	}
	if (Std.is(untyped System.capabilities.hasStreamingAudio, Bool) ){
	  DejaGnu.pass("System.capabilities.hasStreamingAudio is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasStreamingAudio is not a bool");
	}
	if (Std.is(untyped System.capabilities.hasScreenPlayback, Bool) ){
	  DejaGnu.pass("System.capabilities.hasScreenPlayback is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasScreenPlayback is not a bool");
	}
	if (Std.is(untyped System.capabilities.hasScreenBroadcast, Bool) ){
	  DejaGnu.pass("System.capabilities.hasScreenBroadcast is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasScreenBroadcast is not a bool");
	}
	if (Std.is(untyped System.capabilities.hasPrinting, Bool) ){
	  DejaGnu.pass("System.capabilities.hasPrinting is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasPrinting is not a bool");
	}
	if (Std.is(untyped System.capabilities.hasMP3, Bool) ){
	  DejaGnu.pass("System.capabilities.hasMP3 is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasMP3 is not a bool");
	}
	if (Std.is(untyped System.capabilities.hasEmbeddedVideo, Bool) ){
	  DejaGnu.pass("System.capabilities.hasEmbeddedVideo is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasEmbeddedVideo is not a bool");
	}
	if (Std.is(untyped System.capabilities.hasAudioEncoder, Bool) ){
	  DejaGnu.pass("System.capabilities.hasAudioEncoder is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasAudioEncoder is not a bool");
	}
	if (Std.is(untyped System.capabilities.hasAudio, Bool) ){
	  DejaGnu.pass("System.capabilities.hasAudio is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasAudio is not a bool");
	}
	if (Std.is(untyped System.capabilities.hasAccessibility, Bool) ){
	  DejaGnu.pass("System.capabilities.hasAccessibility is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasAccessibility is not a bool");
	}
	if (Std.is(untyped System.capabilities.avHardwareDisable, Bool) ){
	  DejaGnu.pass("System.capabilities.avHardwareDisable is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.avHardwareDisable is not a bool");
	}
	if (Std.is(untyped System.capabilities.windowlessDisable, Bool) ){
	  DejaGnu.pass("System.capabilities.windowlessDisable is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.windowlessDisable is not a bool");
	}
	DejaGnu.note("System.capabilities.hasIME certainly fails on the pp on\n some platforms. There's no verification that it exists at all so far.");
	 if (untyped __typeof__(System.capabilities.hasIME) == 'boolean' ){
	  DejaGnu.pass("System.capabilities.hasIME is a boolean");
	} else {
	    DejaGnu.xfail("System.capabilities.hasIME is not a boolean");
	}
#end

/*
#if flash9
	if (Std.is(untyped System.capabilities.hasTLS,Bool) ){
	 DejaGnu.pass("System.capabilities.hasTLS is a bool");
	} else {
	    DejaGnu.fail("System.capabilities.hasTLS is not a bool");
	}
#end
*/
	// System.exactSettings
#if (flash6 || flash7 ||flash8 )
	if (Std.is(untyped System.exactSettings, Bool) ){
	 DejaGnu.pass("System.exactSettings is a bool");
	} else {
	    DejaGnu.fail("System.exactSetting is not a bool");
	}
	if (Std.is(untyped System.useCodepage, Bool) ){
	 DejaGnu.pass("System.useCodepage is a bool");
	} else {
	    DejaGnu.fail("System.useCodepage is not a bool");
	}
#end

#if flash9
	if (Std.is(untyped System.useCodePage, Bool) ){
		 DejaGnu.pass("System.useCodePage is a bool");
	} else {
	    DejaGnu.fail("System.useCodePage is not a bool");
	}
#end

#if (flash6 || flash7 ||flash8 )
	if (untyped System.Product.prototype.hasOwnProperty("launch") ){
		DejaGnu.xpass("System.Product.ptototype 'launch' should not exist, but it exists");   
	} else {
		DejaGnu.xfail("System.Product.ptototype 'launch' should not exist."); 
		
	}
	if (untyped System.Product.prototype.hasOwnProperty("download") ){
    	    DejaGnu.xpass("System.Product.hasOwnProperty 'download' should not exist, but it exists");
	} else {
	    DejaGnu.xfail("System.Product.hasOwnProperty 'download' should not exist");
	}
#end

#if flash9
//	Si
// 	The property 'exactSettings' has been moved to the flash.System.Security class.
	System.useCodePage = true;
	if ( System.useCodePage == true)
	{
	 DejaGnu.pass("System.useCodePage set to true");
	} else {
	    DejaGnu.fail("System.useCodePage was not set to true");
	}

	System.useCodePage = false;
	if ( System.useCodePage == false)
	{
	 DejaGnu.pass("System.useCodePage set to false");
	} else {
	    DejaGnu.fail("System.useCodePage was not set to false");
	}
#else
	System.exactSettings = true;
	if ( System.exactSettings == true)
	{
	 DejaGnu.pass("System.exactSetting is true");
	} else {
	    DejaGnu.fail("System.capabilities is false");
	}
	System.exactSettings = false;
	if ( System.exactSettings == false)
	{
	 DejaGnu.xpass("System.exactSetting is false");
	} else {
	    DejaGnu.xfail("System.exactSetting is set to be false, but is true");
	}
	System.useCodepage = true;
	if ( System.useCodepage == true)
	{
	 DejaGnu.xpass("System.useCodepage is true");
	} else {
	    DejaGnu.xfail("System.useCodepage is set to be true, but is false");
	}
	System.useCodepage = false;
	if ( System.useCodepage == false)
	{
	 DejaGnu.pass("System.useCodepage is false");
	} else {
	    DejaGnu.fail("System.useCodepage is true");
	}	
#end

#if flash9
#else
if (untyped __typeof__(System.showSettings) == 'function') {
	DejaGnu.pass("Type of System.showSetting is a 'function'.");
} else {
	DejaGnu.fail("Type of System.showSetting is not a 'function'.");
}
#end
if (untyped __typeof__(System.Product) == 'function') {
	DejaGnu.xpass("Type of System.Product is a 'function'.");
} else {
	DejaGnu.xfail("Type of System.Product is not a 'function'.");
}

//Si
//FIX ME:
//The following test in Ming has not been implemented yet.

//Si
//Fixed the these 'p = new System.Product("whatisthis")' tests.

//p = new System.Product("whatisthis");
//xcheck_equals(typeof(p), 'object');
// Tries to do something with 'whatisthis'
//xcheck_equals(typeof(p.download), 'function');
// Tries to exec whatisthis from a particular location?
//xcheck_equals(typeof(p.launch), 'function');
//	xcheck_equals(typeof(System.Product), 'function');

#if (flash6 || flash7 || flash8)
var p = untyped System.Product("whatisthis");

//DejaGnu.note("type of p: " +Std.string(untyped __typeof__(p)) );
//DejaGnu.note("type of p.download:" + Std.string(untyped __typeof__(p.download))  );
//DejaGnu.note("type of p.launch:" + Std.string(untyped __typeof__(p.launch))  );

if (Std.string(untyped __typeof__(p)) == 'object') {
	DejaGnu.xpass("Type of p is 'object'");
} else {
	DejaGnu.xfail("Type of p should be 'object', is "+untyped __typeof__(p));
}
if (Std.string(untyped __typeof__(p.download)) == 'function') {
	DejaGnu.xpass("Type of p.download is 'function'.");
} else {
	DejaGnu.xfail("Type of p.donwload should be 'function', is "+untyped __typeof__(p.download));
}
if (Std.string(untyped __typeof__(p.launch)) == 'function') {
	DejaGnu.xpass("Type of p.launch is 'function'.");
} else {
	DejaGnu.xfail("Type of p.launch should be 'function', is "+untyped __typeof__(p));
}
#else
#end


//Si
//FIXME:
//The following things have not been checked, since the capabilities class has been moved out.
// If you want, you can probably make a comparision of the string 

/*
#if (flash6 || flash7 || flash9)

//      check_equals(typeof($version), 'string');
//if(Std.string(untyped __typeof__($version)) == 'string'){
//	DejaGnu.xpass("Type of '$version' is 'string'");
//} else {
//	DejaGnu.xfail("Type of '$version' is 'string'");
//}

//	check_equals(System.capabilities.version, $version);
//if(Std.string(untyped (System.capabilities.version)) == '$version'){
//	DejaGnu.xpass("Type of 'System.capabilities.version' is '$version'");
//} else {
//	DejaGnu.xfail("Type of 'System.capabilities.version' is '$version'");
//}

//	check_equals(typeof(_global.$version), 'undefined');
//	check_equals(typeof(this.$version), 'string');
//	check_equals(this.$version, System.capabilities.version);

//DejaGnu.note("type of version: " +Std.string(untyped __typeof__($version)) );
//DejaGnu.note("System.capabilities.version " +Std.string(untyped System.capabilities.version) );
//DejaGnu.note("type of _global.$version: " +Std.string(untyped __typeof__(_global.$version)) ;
//DejaGnu.note("type of this.$version: " +Std.string(untyped __typeof__(this.$version)) ;
#else
	//Do nothing in flash9
#end

*/
	DejaGnu.done();
	// Call this after finishing all tests. It prints out the totals.
    }
}

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

