2 // Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 // Test case for Mouse ActionScript class
21 // compile this test case with Ming makeswf, and then
22 // execute it like this gnash -1 -r 0 -v out.swf
28 check_equals
( typeof(Mouse), 'object' );
30 // Mouse object can't be instanciated !
31 var mouseObj
= new Mouse;
32 check_equals
(mouseObj
, undefined);
34 check_equals
(typeof(Mouse.__proto__
), 'object');
35 check_equals
(Mouse.__proto__
, Object.prototype
);
37 // test the Mouse::hide method
38 check_equals
( typeof(Mouse.hide
), 'function' );
39 check_equals
( typeof(Mouse.show
), 'function' );
40 #if OUTPUT_VERSION
> 5
42 // Mouse was implicitly initialized by ASBroadcaster.initialize !
43 // See http://www.senocular.com/flash/tutorials/listenersasbroadcaster/?page=2
44 check_equals
( typeof(Mouse.removeListener
), 'function' );
45 check_equals
( typeof(Mouse.addListener
), 'function' );
46 check_equals
( typeof(Mouse.broadcastMessage
), 'function' );
47 check
(Mouse.hasOwnProperty
("_listeners"));
48 check_equals
(typeof(Mouse._listeners
), 'object');
49 check
(Mouse._listeners
instanceof Array);
51 check
(Mouse.hasOwnProperty
("hide"));
52 check
(Mouse.hasOwnProperty
("show"));
54 #endif
// OUTPUT_VERSION > 5
57 // test the Mouse::show method
58 check_equals
( typeof(Mouse.show
), 'function' );
59 #if OUTPUT_VERSION
> 5