~ubuntu-branches/ubuntu/maverick/gnash/maverick

« back to all changes in this revision

Viewing changes to testsuite/misc-haxe.all/classes.all/ui/ContextMenuItem_as.hx

  • Committer: Bazaar Package Importer
  • Author(s): Micah Gersten, Micah Gersten, Chris Coulson
  • Date: 2010-09-28 23:38:37 UTC
  • mfrom: (1.1.14 upstream) (3.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20100928233837-wcay0dodera1c7sz
Tags: 0.8.8-5ubuntu1
[ Micah Gersten <micahg@ubuntu.com> ]
* FFe - LP: #636667
* Merge from debian unstable.  Remaining changes:
  + Add Ubuntu flash alternatives in postinst and prerm
    - update debian/browser-plugin-gnash.postinst
    - update debian/browser-plugin-gnash.prerm

[ Chris Coulson <chris.coulson@canonical.com> ]
* Ensure the directories we are installing alternatives too exist
  already
  - add debian/browser-plugin-gnash.dirs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// ContextMenuItem_as.hx:  ActionScript 3 "ContextMenuItem" class, for Gnash.
2
 
//
3
 
// Generated by gen-as3.sh on: 20090515 by "rob". Remove this
4
 
// after any hand editing loosing changes.
5
 
//
6
 
//   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
7
 
//
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.
12
 
//
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.
17
 
//
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
21
 
//
22
 
 
23
 
// This test case must be processed by CPP before compiling to include the
24
 
//  DejaGnu.hx header file for the testing framework support.
25
 
 
26
 
#if flash9
27
 
import flash.ui.ContextMenuItem;
28
 
import flash.display.MovieClip;
29
 
#else
30
 
import flash.ContextMenuItem;
31
 
import flash.MovieClip;
32
 
import flash.ContextMenu;
33
 
#end
34
 
import flash.Lib;
35
 
import Type;
36
 
import Std;
37
 
 
38
 
// import our testing API
39
 
import DejaGnu;
40
 
 
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() {
44
 
        #if flash9
45
 
                var x1:ContextMenuItem = new ContextMenuItem("Caption", false, true, true);
46
 
 
47
 
        // Make sure we actually get a valid class        
48
 
        if (x1 != null) {
49
 
            DejaGnu.pass("ContextMenuItem class exists");
50
 
        } else {
51
 
            DejaGnu.fail("ContextMenuItem class doesn't exist");
52
 
        }
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");
58
 
        } else {
59
 
            DejaGnu.fail("ContextMenuItem.caption property doesn't exist");
60
 
        }
61
 
        if (Type.typeof(x1.separatorBefore) == ValueType.TBool) {
62
 
            DejaGnu.pass("ContextMenuItem.separatorBefore property exists");
63
 
        } else {
64
 
            DejaGnu.fail("ContextMenuItem.separatorBefore property doesn't exist");
65
 
        }
66
 
        if (Type.typeof(x1.visible) == ValueType.TBool) {
67
 
            DejaGnu.pass("ContextMenuItem.visible property exists");
68
 
        } else {
69
 
            DejaGnu.fail("ContextMenuItem.visible property doesn't exist");
70
 
        }
71
 
//FIXME: test methods (not implemented in haxe)
72
 
//      if (Type.typeof(x1.clone) == ValueType.TFunction) {
73
 
//              DejaGnu.pass("ContextMenuItem::clone method exists");
74
 
//      } else {
75
 
//              DejaGnu.fail("ContextMenuItem::clone method exists");
76
 
//      }
77
 
//      if (Type.typeof(x1.systemClearMenuItem) == ValueType.TFunction) {
78
 
//              DejaGnu.pass("ContextMenuItem::systemClearMenuItem method exists");
79
 
//      } else {
80
 
//              DejaGnu.fail("ContextMenuItem::systemClearMenuItem method exists");
81
 
//      }
82
 
//      if (Type.typeof(x1.systemCopyLinkMenuItem) == ValueType.TFunction) {
83
 
//              DejaGnu.pass("ContextMenuItem::systemCopyLinkMenuItem method exists");
84
 
//      } else {
85
 
//              DejaGnu.fail("ContextMenuItem::systemCopyLinkMenuItem method exists");
86
 
//      }
87
 
//      if (Type.typeof(x1.systemCopyMenuItem) == ValueType.TFunction) {
88
 
//              DejaGnu.pass("ContextMenuItem::systemCopyMenuItem method exists");
89
 
//      } else {
90
 
//              DejaGnu.fail("ContextMenuItem::systemCopyMenuItem method exists");
91
 
//      }
92
 
//      if (Type.typeof(x1.systemCutMenuItem) == ValueType.TFunction) {
93
 
//              DejaGnu.pass("ContextMenuItem::systemCutMenuItem method exists");
94
 
//      } else {
95
 
//              DejaGnu.fail("ContextMenuItem::systemCutMenuItem method exists");
96
 
//      }
97
 
//      if (Type.typeof(x1.systemOpenLinkMenuItem) == ValueType.TFunction) {
98
 
//              DejaGnu.pass("ContextMenuItem::systemLinkMenuItem method exists");
99
 
//      } else {
100
 
//              DejaGnu.fail("ContextMenuItem::systemLinkMenuItem method exists");
101
 
//      }
102
 
//      if (Type.typeof(x1.systemPasteMenuItem) == ValueType.TFunction) {
103
 
//              DejaGnu.pass("ContextMenuItem::systemPasteMenuItem method exists");
104
 
//      } else {
105
 
//              DejaGnu.fail("ContextMenuItem::systemPasteMenuItem method exists");
106
 
//      }
107
 
//      if (Type.typeof(x1.systemSelectAllMenuItem) == ValueType.TFunction) {
108
 
//              DejaGnu.pass("ContextMenuItem::systemSelectAllMenuItem method exists");
109
 
//      } else {
110
 
//              DejaGnu.fail("ContextMenuItem::systemSelectAllMenuItem method exists");
111
 
//      }
112
 
        #end
113
 
        #if (flash7 || flash8)
114
 
                DejaGnu.note("Use the ContextMenu_as test to make sure this is working");
115
 
        #end
116
 
        // Call this after finishing all tests. It prints out the totals.
117
 
        DejaGnu.done();
118
 
    }
119
 
}
120
 
 
121
 
// local Variables:
122
 
// mode: C++
123
 
// indent-tabs-mode: t
124
 
// End:
125