Merge branch 'master' of git.sv.gnu.org:/srv/git/gnash
[gnash.git] / testsuite / misc-ming.all / attachMovieLoopingTestRunner.cpp
blob76a2de11dd09d906217964b75f4f0540266ec0da
1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 *
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.
8 *
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
19 */
21 #define INPUT_FILENAME "attachMovieLoopingTest.swf"
23 #include "MovieTester.h"
24 #include "MovieClip.h"
25 #include "DisplayObject.h"
26 #include "DisplayList.h"
27 #include "log.h"
29 #include "check.h"
30 #include <string>
31 #include <cassert>
33 using namespace gnash;
34 using namespace std;
36 int
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();
46 assert(root);
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());