1
// ContextMenuItem_as.hx: ActionScript 3 "ContextMenuItem" class, for Gnash.
3
// Generated by gen-as3.sh on: 20090515 by "rob". Remove this
4
// after any hand editing loosing changes.
6
// Copyright (C) 2009, 2010 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.ui.ContextMenuItem;
28
import flash.display.MovieClip;
30
import flash.ContextMenuItem;
31
import flash.MovieClip;
32
import flash.ContextMenu;
38
// import our testing API
41
// Class must be named with the _as suffix, as that's the same name as the file.
42
class ContextMenuItem_as {
43
static function main() {
45
var x1:ContextMenuItem = new ContextMenuItem("Caption", false, true, true);
47
// Make sure we actually get a valid class
49
DejaGnu.pass("ContextMenuItem class exists");
51
DejaGnu.fail("ContextMenuItem class doesn't exist");
53
// Tests to see if all the properties exist. All these do is test for
54
// existance of a property, and don't test the functionality at all. This
55
// is primarily useful only to test completeness of the API implementation.
56
if (Std.is(x1.caption, String) && (Std.string(x1.caption) == "Caption")) {
57
DejaGnu.pass("ContextMenuItem.caption property exists");
59
DejaGnu.fail("ContextMenuItem.caption property doesn't exist");
61
if (Type.typeof(x1.separatorBefore) == ValueType.TBool) {
62
DejaGnu.pass("ContextMenuItem.separatorBefore property exists");
64
DejaGnu.fail("ContextMenuItem.separatorBefore property doesn't exist");
66
if (Type.typeof(x1.visible) == ValueType.TBool) {
67
DejaGnu.pass("ContextMenuItem.visible property exists");
69
DejaGnu.fail("ContextMenuItem.visible property doesn't exist");
71
//FIXME: test methods (not implemented in haxe)
72
// if (Type.typeof(x1.clone) == ValueType.TFunction) {
73
// DejaGnu.pass("ContextMenuItem::clone method exists");
75
// DejaGnu.fail("ContextMenuItem::clone method exists");
77
// if (Type.typeof(x1.systemClearMenuItem) == ValueType.TFunction) {
78
// DejaGnu.pass("ContextMenuItem::systemClearMenuItem method exists");
80
// DejaGnu.fail("ContextMenuItem::systemClearMenuItem method exists");
82
// if (Type.typeof(x1.systemCopyLinkMenuItem) == ValueType.TFunction) {
83
// DejaGnu.pass("ContextMenuItem::systemCopyLinkMenuItem method exists");
85
// DejaGnu.fail("ContextMenuItem::systemCopyLinkMenuItem method exists");
87
// if (Type.typeof(x1.systemCopyMenuItem) == ValueType.TFunction) {
88
// DejaGnu.pass("ContextMenuItem::systemCopyMenuItem method exists");
90
// DejaGnu.fail("ContextMenuItem::systemCopyMenuItem method exists");
92
// if (Type.typeof(x1.systemCutMenuItem) == ValueType.TFunction) {
93
// DejaGnu.pass("ContextMenuItem::systemCutMenuItem method exists");
95
// DejaGnu.fail("ContextMenuItem::systemCutMenuItem method exists");
97
// if (Type.typeof(x1.systemOpenLinkMenuItem) == ValueType.TFunction) {
98
// DejaGnu.pass("ContextMenuItem::systemLinkMenuItem method exists");
100
// DejaGnu.fail("ContextMenuItem::systemLinkMenuItem method exists");
102
// if (Type.typeof(x1.systemPasteMenuItem) == ValueType.TFunction) {
103
// DejaGnu.pass("ContextMenuItem::systemPasteMenuItem method exists");
105
// DejaGnu.fail("ContextMenuItem::systemPasteMenuItem method exists");
107
// if (Type.typeof(x1.systemSelectAllMenuItem) == ValueType.TFunction) {
108
// DejaGnu.pass("ContextMenuItem::systemSelectAllMenuItem method exists");
110
// DejaGnu.fail("ContextMenuItem::systemSelectAllMenuItem method exists");
113
#if (flash7 || flash8)
114
DejaGnu.note("Use the ContextMenu_as test to make sure this is working");
116
// Call this after finishing all tests. It prints out the totals.
123
// indent-tabs-mode: t