1
// Security_as3.hx: ActionScript 3 "Security" class, for Gnash.
3
// Generated by gen-as3.sh on: 20090514 by "rob". Remove this
4
// after any hand editing loosing changes.
6
// Copyright (C) 2009 Free Software Foundation, Inc.
8
// This program is free software; you can redistribute it and/or modify
9
// it under the terms of the GNU General Public License as published by
10
// the Free Software Foundation; either version 3 of the License, or
11
// (at your option) any later version.
13
// This program is distributed in the hope that it will be useful,
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
// GNU General Public License for more details.
18
// You should have received a copy of the GNU General Public License
19
// along with this program; if not, write to the Free Software
20
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
// This test case must be processed by CPP before compiling to include the
24
// DejaGnu.hx header file for the testing framework support.
27
import flash.display.MovieClip;
29
import flash.MovieClip;
37
import flash.system.Security;
39
// import our testing API
42
// Class must be named with the _as3 suffix, as that's the same name as the file.
45
static var undef = untyped __global__["undefined"];
47
static function main() {
49
// Make sure we actually get a valid class
50
if (Type.typeof(Security)==TObject) {
51
DejaGnu.pass("Security class exists");
53
DejaGnu.fail("Security class doesn't exist");
55
// Tests to see if all the properties exist. All these do is test for
56
// existance of a property, and don't test the functionality at all. This
57
// is primarily useful only to test completeness of the API implementation.
63
if (Type.typeof(Security.exactSettings) == TBool) {
64
DejaGnu.pass("Security.exactSettings property exists");
66
DejaGnu.fail("Security.exactSettings property doesn't exist");
71
// For pp, Security.sandboxType returns a string, hence the xfail
73
if (Type.typeof(Security.sandboxType) == ValueType.TNull) {
74
DejaGnu.pass("Security.sandboxType property exists");
76
DejaGnu.xfail("Security.sandboxType property doesn't exist");
81
if (Std.is(Security.sandboxType, String) ) {
82
DejaGnu.pass("Security.sandboxType property exists");
84
DejaGnu.fail("Security.sandboxType property doesn't exist");
88
// Tests to see if all the methods exist. All these do is test for
89
// existance of a method, and don't test the functionality at all. This
90
// is primarily useful only to test completeness of the API implementation.
93
if (Type.typeof(Security.allowDomain) == TFunction) {
94
DejaGnu.pass("Security::allowDomain() method exists");
96
DejaGnu.fail("Security::allowDomain() method doesn't exist");
98
var ret = Security.allowDomain("cnn.com");
101
if (Type.typeof(Security.allowInsecureDomain) == TFunction) {
102
DejaGnu.pass("Security::allowInsecureDomain() method exists");
104
DejaGnu.fail("Security::allowInsecureDomain() method doesn't exist");
107
if (Type.typeof(Security.loadPolicyFile) == TFunction) {
108
DejaGnu.pass("Security::loadPolicyFile() method exists");
110
DejaGnu.fail("Security::loadPolicyFile() method doesn't exist");
114
if (Type.typeof(Security.showSettings)==TFunction) {
115
DejaGnu.pass("Security::showSettings() method exists");
117
DejaGnu.fail("Security::showSettings() method doesn't exist");
122
// if (Security.APPLICATION == null) {
123
// DejaGnu.pass("Security::APPLICATION() method exists");
125
// DejaGnu.fail("Security::APPLICATION() method doesn't exist");
129
if (Std.is(Security.LOCAL_TRUSTED,String) ) {
130
DejaGnu.pass("Security::LOCAL_TRUSTED() property exists");
132
DejaGnu.fail("Security::LOCAL_TRUSTED() property doesn't exist");
134
if (Std.is(Security.LOCAL_WITH_FILE,String) ) {
135
DejaGnu.pass("Security::LOCAL_WITH_FILE() property exists");
137
DejaGnu.fail("Security::LOCAL_WITH_FILE() method doesn't exist");
139
if (Std.is(Security.LOCAL_WITH_NETWORK,String) ) {
140
DejaGnu.pass("Security::LOCAL_WITH_NETWORK() property exists");
142
DejaGnu.fail("Security::LOCAL_WITH_NETWORK() property doesn't exist");
144
if (Std.is(Security.REMOTE,String)) {
145
DejaGnu.pass("Security::REMOTE() property exists");
147
DejaGnu.fail("Security::REMOTE() property doesn't exist");
149
if (Type.typeof(Security.disableAVM1Loading) == TBool ){
150
DejaGnu.pass("Security::disableAVM1Loading property xists");
152
DejaGnu.fail("Security::disableAVM1Loading property doesn't exist");
155
// Call this after finishing all tests. It prints out the totals.
162
// indent-tabs-mode: t