big merge from master, fix rpm creation, drop fetching swfdec
[gnash.git] / testsuite / misc-ming.all / registerClassTestRunner.cpp
bloba964af5911f60aaac9a82a23e5f70d4110ab039a
1 /*
2 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3 * 2011 Free Software Foundation, Inc.
4 *
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.
9 *
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 */
22 #define INPUT_FILENAME "registerClassTest.swf"
24 #include "MovieTester.h"
25 #include "MovieClip.h"
26 #include "DisplayObject.h"
27 #include "DisplayList.h"
28 #include "log.h"
30 #include "check.h"
31 #include <string>
32 #include <cassert>
34 using namespace gnash;
35 using namespace std;
37 int
38 main(int /*argc*/, char** /*argv*/)
40 string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
41 MovieTester tester(filename);
43 gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
44 dbglogfile.setVerbosity(1);
46 MovieClip* root = tester.getRootMovie();
47 assert(root);
49 check_equals(root->get_frame_count(), 6);
50 check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
51 check_equals(root->get_current_frame(), 0);
53 check(! tester.findDisplayItemByDepth(*root, 71) );
54 check(! tester.findDisplayItemByDepth(*root, 72) );
56 tester.movePointerTo(30, 30);
57 check(!tester.isMouseOverMouseEntity());
59 tester.advance();
60 check_equals(root->get_current_frame(), 1);
62 check( tester.findDisplayItemByDepth(*root, 71) );
63 check(! tester.findDisplayItemByDepth(*root, 72) );
65 tester.movePointerTo(30, 30);
66 check(tester.isMouseOverMouseEntity());
67 tester.movePointerTo(100, 30);
68 check(!tester.isMouseOverMouseEntity());
70 tester.advance();
71 check_equals(root->get_current_frame(), 2);
73 check(tester.findDisplayItemByDepth(*root, 71) );
74 check(tester.findDisplayItemByDepth(*root, 72) );
76 tester.movePointerTo(30, 30);
77 check(tester.isMouseOverMouseEntity());
78 tester.movePointerTo(100, 30);
79 check(tester.isMouseOverMouseEntity());
81 tester.advance();
82 check_equals(root->get_current_frame(), 3);
84 check(tester.findDisplayItemByDepth(*root, 71) );
85 check(tester.findDisplayItemByDepth(*root, 72) );
86 check(tester.findDisplayItemByDepth(*root, 73) );
88 tester.movePointerTo(30, 30);
89 check(tester.isMouseOverMouseEntity());
90 tester.movePointerTo(100, 30);
91 check(tester.isMouseOverMouseEntity());
92 tester.movePointerTo(170, 30);
93 check(tester.isMouseOverMouseEntity());
95 tester.advance();
96 check_equals(root->get_current_frame(), 4);
98 tester.movePointerTo(30, 30);
99 check(tester.isMouseOverMouseEntity());
100 tester.movePointerTo(100, 30);
101 check(tester.isMouseOverMouseEntity());
102 tester.movePointerTo(170, 30);
103 check(tester.isMouseOverMouseEntity());
104 tester.movePointerTo(240, 30);
105 check(tester.isMouseOverMouseEntity());
107 tester.advance();
108 check_equals(root->get_current_frame(), 5);
110 tester.advance();
111 check_equals(root->get_current_frame(), 5); // we should be in stop mode