~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to testsuite/misc-haxe.all/classes.all/text/StyleSheet_as.hx

  • Committer: Bazaar Package Importer
  • Author(s): Sindhudweep Narayan Sarkar
  • Date: 2009-10-07 00:06:10 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20091007000610-mj9rwqe774gizn1j
Tags: 0.8.6-0ubuntu1
new upstream release 0.8.6 (LP: #435897)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// StyleSheet_as.hx:  ActionScript 3 "StyleSheet" 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 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.text.StyleSheet;
 
28
import flash.display.MovieClip;
 
29
#else
 
30
import flash.MovieClip;
 
31
#end
 
32
import flash.Lib;
 
33
import Type;
 
34
import Std;
 
35
 
 
36
// import our testing API
 
37
import DejaGnu;
 
38
 
 
39
// Class must be named with the _as suffix, as that's the same name as the file.
 
40
class StyleSheet_as {
 
41
    static function main() {
 
42
        
 
43
#if flash9
 
44
        var x1:StyleSheet = new StyleSheet();
 
45
 
 
46
        // Make sure we actually get a valid class        
 
47
        if (x1 != null) {
 
48
            DejaGnu.pass("StyleSheet class exists");
 
49
        } else {
 
50
            DejaGnu.fail("StyleSheet class doesn't exist");
 
51
        }
 
52
        // Tests to see if all the properties exist. All these do is test for
 
53
        // existance of a property, and don't test the functionality at all. This
 
54
        // is primarily useful only to test completeness of the API implementation.
 
55
        if (Std.is(x1.styleNames, Dynamic)) {
 
56
            DejaGnu.pass("StyleSheet.styleNames property exists");
 
57
        } else {
 
58
            DejaGnu.fail("StyleSheet.styleNames property doesn't exist");
 
59
        }
 
60
 
 
61
        // Tests to see if all the methods exist. All these do is test for
 
62
        // existance of a method, and don't test the functionality at all. This
 
63
        // is primarily useful only to test completeness of the API implementation.
 
64
        if (Type.typeof(x1.getStyle)==ValueType.TFunction) {
 
65
            DejaGnu.pass("StyleSheet::getStyle() method exists");
 
66
        } else {
 
67
            DejaGnu.fail("StyleSheet::getStyle() method doesn't exist");
 
68
        }
 
69
        if (Type.typeof(x1.setStyle)==ValueType.TFunction) {
 
70
            DejaGnu.pass("StyleSheet::setStyle() method exists");
 
71
        } else {
 
72
            DejaGnu.fail("StyleSheet::setStyle() method doesn't exist");
 
73
        }
 
74
        if (Type.typeof(x1.clear)==ValueType.TFunction) {
 
75
            DejaGnu.pass("StyleSheet::clear() method exists");
 
76
        } else {
 
77
            DejaGnu.fail("StyleSheet::clear() method doesn't exist");
 
78
        }
 
79
        
 
80
        if (Type.typeof(x1.parseCSS)==ValueType.TFunction) {
 
81
            DejaGnu.pass("StyleSheet::parseCSS() method exists");
 
82
        } else {
 
83
            DejaGnu.fail("StyleSheet::parseCSS() method doesn't exist");
 
84
        }
 
85
        
 
86
        if (Type.typeof(x1.transform)==ValueType.TFunction) {
 
87
            DejaGnu.pass("StyleSheet::transform() method exists");
 
88
        } else {
 
89
            DejaGnu.fail("StyleSheet::transform() method doesn't exist");
 
90
            DejaGnu.note("transform: " + Type.typeof(x1.transform));
 
91
        }
 
92
 
 
93
 
 
94
#else
 
95
    DejaGnu.note("StyleSheet did not exist before SWF9");
 
96
#end
 
97
 
 
98
        // Call this after finishing all tests. It prints out the totals.
 
99
        DejaGnu.done();
 
100
    }
 
101
}
 
102
 
 
103
// local Variables:
 
104
// mode: C++
 
105
// indent-tabs-mode: t
 
106
// End:
 
107