2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #define INPUT_FILENAME "attachMovieLoopingTest.swf"
23 #include "MovieTester.h"
24 #include "MovieClip.h"
25 #include "DisplayObject.h"
26 #include "DisplayList.h"
33 using namespace gnash
;
37 main(int /*argc*/, char** /*argv*/)
39 string filename
= string(TGTDIR
) + string("/") + string(INPUT_FILENAME
);
40 MovieTester
tester(filename
);
42 gnash::LogFile
& dbglogfile
= gnash::LogFile::getDefaultInstance();
43 dbglogfile
.setVerbosity(1);
45 MovieClip
* root
= tester
.getRootMovie();
48 check_equals(root
->get_frame_count(), 2);
49 check_equals(root
->getPlayState(), MovieClip::PLAYSTATE_PLAY
);
50 check_equals(root
->get_current_frame(), 0);
52 check(! tester
.findDisplayItemByDepth(*root
, 70) );
53 check(! tester
.findDisplayItemByDepth(*root
, 71) );
54 check(! tester
.findDisplayItemByDepth(*root
, 72) );
55 check(! tester
.findDisplayItemByDepth(*root
, 73) );
57 tester
.movePointerTo(30, 30);
58 check(!tester
.isMouseOverMouseEntity());
60 tester
.advance(); check_equals(root
->get_current_frame(), 1);
62 check(tester
.findDisplayItemByDepth(*root
, 70) );
63 check(! tester
.findDisplayItemByDepth(*root
, 71) );
64 check(! tester
.findDisplayItemByDepth(*root
, 72) );
65 check(! tester
.findDisplayItemByDepth(*root
, 73) );
67 tester
.movePointerTo(30, 30);
68 check(tester
.isMouseOverMouseEntity());
69 tester
.movePointerTo(100, 30);
70 check(!tester
.isMouseOverMouseEntity());
72 tester
.advance(); check_equals(root
->get_current_frame(), 0);
73 tester
.advance(); check_equals(root
->get_current_frame(), 1);
75 check( tester
.findDisplayItemByDepth(*root
, 70) );
76 check( tester
.findDisplayItemByDepth(*root
, 71) );
77 check(! tester
.findDisplayItemByDepth(*root
, 72) );
78 check(! tester
.findDisplayItemByDepth(*root
, 73) );
80 tester
.movePointerTo(100, 5);
81 check(tester
.isMouseOverMouseEntity());
82 tester
.movePointerTo(170, 30);
83 check(!tester
.isMouseOverMouseEntity());
85 tester
.advance(); check_equals(root
->get_current_frame(), 0);
86 tester
.advance(); check_equals(root
->get_current_frame(), 1);
88 check( tester
.findDisplayItemByDepth(*root
, 70) );
89 check( tester
.findDisplayItemByDepth(*root
, 71) );
90 check( tester
.findDisplayItemByDepth(*root
, 72) );
91 check(! tester
.findDisplayItemByDepth(*root
, 73) );
93 tester
.movePointerTo(170, 10);
94 check(tester
.isMouseOverMouseEntity());
95 tester
.movePointerTo(240, 30);
96 check(!tester
.isMouseOverMouseEntity());
98 tester
.advance(); check_equals(root
->get_current_frame(), 0);
99 tester
.advance(); check_equals(root
->get_current_frame(), 1);
101 check( tester
.findDisplayItemByDepth(*root
, 70) );
102 check( tester
.findDisplayItemByDepth(*root
, 71) );
103 check( tester
.findDisplayItemByDepth(*root
, 72) );
104 check( tester
.findDisplayItemByDepth(*root
, 73) );
106 tester
.movePointerTo(240, 5);
107 check(tester
.isMouseOverMouseEntity());