CVSROOT: /sources/gnash Module name: gnash Changes by: Benjamin Wolsey <bwy> 08/02/13 14:44:15
Modified files: . : ChangeLog testsuite/misc-ming.all: Makefile.am PrototypeEventListeners.as Added files: testsuite/misc-ming.all: PrototypeEventListenersTestRunner.cpp Log message: * testsuite/misc-ming.all/PrototypeEventListenersTestRunner.cpp: automatic test runner. * testsuite/misc-ming.all/Makefile.am: enable tests. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5636&r2=1.5637 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.180&r2=1.181 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/PrototypeEventListeners.as?cvsroot=gnash&r1=1.1&r2=1.2 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/PrototypeEventListenersTestRunner.cpp?cvsroot=gnash&rev=1.1 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.5636 retrieving revision 1.5637 diff -u -b -r1.5636 -r1.5637 --- ChangeLog 13 Feb 2008 14:02:47 -0000 1.5636 +++ ChangeLog 13 Feb 2008 14:44:13 -0000 1.5637 @@ -1,3 +1,11 @@ +2008-02-13 Benjamin Wolsey <[EMAIL PROTECTED]> + + * testsuite/misc-ming.all/PrototypeEventListeners.as: a few more + tests. + * testsuite/misc-ming.all/PrototypeEventListenersTestRunner.cpp: + automatic test runner. + * testsuite/misc-ming.all/Makefile.am: enable tests. + 2008-02-13 Sandro Santilli <[EMAIL PROTECTED]> * server/asobj/SharedObject.cpp: fix intermediate directories Index: testsuite/misc-ming.all/Makefile.am =================================================================== RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v retrieving revision 1.180 retrieving revision 1.181 diff -u -b -r1.180 -r1.181 --- testsuite/misc-ming.all/Makefile.am 13 Feb 2008 05:24:20 -0000 1.180 +++ testsuite/misc-ming.all/Makefile.am 13 Feb 2008 14:44:14 -0000 1.181 @@ -30,6 +30,7 @@ testrun.log EXTRA_DIST = VarAndCharClashTest.as \ + PrototypeEventListeners.as \ DragDropTest.as \ gotoFrame2Test.as \ DrawingApiTest.as \ @@ -140,6 +141,7 @@ eventSoundTest1 \ eventSoundTest1-Runner \ DrawingApiTestRunner \ + PrototypeEventListenersTestRunner \ DragDropTestRunner \ frame_label_test \ path_format_test \ @@ -1529,6 +1531,24 @@ DrawingApiTest.swf \ $(NULL) +PrototypeEventListeners.swf: $(srcdir)/PrototypeEventListeners.as Dejagnu.swf Makefile ../actionscript.all/check.as ../actionscript.all/utils.as + $(MAKESWF) -r12 -o $@ -v6 -DUSE_DEJAGNU_MODULE -DOUTPUT_VERSION=6 Dejagnu.swf $(srcdir)/PrototypeEventListeners.as + +PrototypeEventListenersTestRunner_SOURCES = \ + PrototypeEventListenersTestRunner.cpp \ + $(NULL) +PrototypeEventListenersTestRunner_CXXFLAGS = \ + -DSRCDIR='"$(srcdir)"' \ + -DTGTDIR='"$(abs_builddir)"' \ + $(NULL) +PrototypeEventListenersTestRunner_LDADD = \ + $(top_builddir)/testsuite/libtestsuite.la \ + $(NULL) +PrototypeEventListenersTestRunner_DEPENDENCIES = \ + $(top_builddir)/testsuite/libtestsuite.la \ + PrototypeEventListeners.swf \ + $(NULL) + DragDropTest.swf: $(srcdir)/DragDropTest.as Dejagnu.swf DragDropTestLoaded.swf Makefile ../actionscript.all/check.as ../actionscript.all/utils.as $(MAKESWF) -r12 -o $@ -v6 -DUSE_DEJAGNU_MODULE -DOUTPUT_VERSION=6 Dejagnu.swf $(srcdir)/DragDropTest.as Index: testsuite/misc-ming.all/PrototypeEventListeners.as =================================================================== RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/PrototypeEventListeners.as,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- testsuite/misc-ming.all/PrototypeEventListeners.as 13 Feb 2008 13:55:02 -0000 1.1 +++ testsuite/misc-ming.all/PrototypeEventListeners.as 13 Feb 2008 14:44:14 -0000 1.2 @@ -12,14 +12,22 @@ #define xfail_check _root.xfail #define xpass_check _root.xpass -rcsid="$Id: PrototypeEventListeners.as,v 1.1 2008/02/13 13:55:02 bwy Exp $"; +rcsid="$Id: PrototypeEventListeners.as,v 1.2 2008/02/13 14:44:14 bwy Exp $"; var countMC; -var countTF; + +// Should remain 0; +var countTF = 0; MovieClip.prototype.onMouseDown = function() { note(this+".onMouseDown"); + check_equals(typeof(this), "movieclip"); + countMC++; +}; + +MovieClip.prototype.onKeyUp = function() { + note(this+".onKeyDown"); note(typeof(this)); countMC++; }; @@ -55,6 +63,7 @@ note("1. Click!"); _root.onMouseDown = function() { + // clip1, clip2, and 2 Dejagnu clips. check_equals(countMC, 4); test2(); }; @@ -68,6 +77,7 @@ _root.onMouseDown = function() { + // clip2 and 2 Dejagnu clips. check_equals(countMC, 3); endOfTest(); }; @@ -75,10 +85,9 @@ endOfTest = function() { + check_totals(9); _root.ENDOFTEST = true; note("END OF TEST"); - check_totals(2); - _root.onMouseDown = undefined; }; test1(); Index: testsuite/misc-ming.all/PrototypeEventListenersTestRunner.cpp =================================================================== RCS file: testsuite/misc-ming.all/PrototypeEventListenersTestRunner.cpp diff -N testsuite/misc-ming.all/PrototypeEventListenersTestRunner.cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ testsuite/misc-ming.all/PrototypeEventListenersTestRunner.cpp 13 Feb 2008 14:44:14 -0000 1.1 @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2007, 2008 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * + */ + +#define INPUT_FILENAME "PrototypeEventListeners.swf" + +#include "MovieTester.h" +#include "sprite_instance.h" +#include "character.h" +#include "dlist.h" +#include "log.h" +#include "Point2d.h" +#include "VM.h" +#include "string_table.h" + +#include "check.h" +#include <string> +#include <cassert> +#include <sstream> + +using namespace gnash; +using namespace gnash::geometry; +using namespace std; + +int +main(int /*argc*/, char** /*argv*/) +{ + string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME); + MovieTester tester(filename); + + gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance(); + dbglogfile.setVerbosity(1); + + sprite_instance* root = tester.getRootMovie(); + assert(root); + + // for variables lookup (consistency checking) + string_table& st = root->getVM().getStringTable(); + + typedef geometry::Point2d<int> IntPoint; + + check_equals(root->get_frame_count(), 1); + check_equals(root->get_current_frame(), 0); + + // first frame is just Dejagnu clip... + tester.advance(); + + check_equals(root->get_current_frame(), 1); + + tester.click(); + + tester.click(); + + // Consistency check !! + as_value eot; + // It's an swf6, so lowercase 'ENDOFTEST' + bool endOfTestFound = root->get_member(st.find("endoftest"), &eot); + check(endOfTestFound); + if ( endOfTestFound ) + { + cerr << eot.to_debug_string() << endl; + check_equals(eot.to_bool(), true); + } + else + { + cerr << "Didn't find ENDOFTEST... dumping all members" << endl; + root->dump_members(); + } + +} + _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit