gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/BitmapMovieInstance.cpp ...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/BitmapMovieInstance.cpp ...
Date: Wed, 18 Apr 2007 15:26:39 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/04/18 15:26:39

Modified files:
        .              : ChangeLog 
        server         : BitmapMovieInstance.cpp 
        testsuite      : MovieTester.h 
        testsuite/misc-ming.all: loadMovieTest.c loadMovieTestRunner.cpp 

Log message:
                * testsuite/MovieTester.h: add click() method.
                * server/BitmapMovieInstance.cpp: place the
                  bitmap character in the "static depth" zone
                  to forbid removal (might still be not enough).
                * testsuite/misc-ming.all/loadMovieTest.c: have
                  the clear button remove the clips, not just clear them
                * testsuite/misc-ming.all/loadMovieTestRunner.cpp:
                  check use of the 'scribble' and 'clear' buttons.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2913&r2=1.2914
http://cvs.savannah.gnu.org/viewcvs/gnash/server/BitmapMovieInstance.cpp?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/MovieTester.h?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/loadMovieTest.c?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/loadMovieTestRunner.cpp?cvsroot=gnash&r1=1.7&r2=1.8

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2913
retrieving revision 1.2914
diff -u -b -r1.2913 -r1.2914
--- ChangeLog   18 Apr 2007 14:39:18 -0000      1.2913
+++ ChangeLog   18 Apr 2007 15:26:38 -0000      1.2914
@@ -1,3 +1,14 @@
+2007-04-18 Sandro Santilli <address@hidden>
+
+       * testsuite/MovieTester.h: add click() method.
+       * server/BitmapMovieInstance.cpp: place the
+         bitmap character in the "static depth" zone
+         to forbid removal (might still be not enough).
+       * testsuite/misc-ming.all/loadMovieTest.c: have
+         the clear button remove the clips, not just clear them
+       * testsuite/misc-ming.all/loadMovieTestRunner.cpp:
+         check use of the 'scribble' and 'clear' buttons.
+
 2007-04-18 Martin Guy <address@hidden>
 
        * server/asobj/NetStreamFfmpeg.cpp: Fix compile-breaking typo.

Index: server/BitmapMovieInstance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/BitmapMovieInstance.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- server/BitmapMovieInstance.cpp      15 Feb 2007 17:51:43 -0000      1.4
+++ server/BitmapMovieInstance.cpp      18 Apr 2007 15:26:38 -0000      1.5
@@ -45,7 +45,7 @@
        assert(chdef);
        boost::intrusive_ptr<character> ch = 
chdef->create_character_instance(this, 1);
        //log_msg("Created char in BitmapMovieInstance is a %s", 
typeid(*ch).name());
-       int depth = 1;
+       int depth = 1+character::staticDepthOffset;
        place_character(ch.get(), depth, cxform(), mat, 1.0, 0);
 }
 

Index: testsuite/MovieTester.h
===================================================================
RCS file: /sources/gnash/gnash/testsuite/MovieTester.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- testsuite/MovieTester.h     27 Feb 2007 09:10:20 -0000      1.11
+++ testsuite/MovieTester.h     18 Apr 2007 15:26:39 -0000      1.12
@@ -94,6 +94,13 @@
        /// Notify mouse button was depressed
        void depressMouseButton();
 
+       /// Simulate a mouse click (press and depress mouse button)
+       void click()
+       {
+               pressMouseButton();
+               depressMouseButton();
+       }
+
        /// Notify key press
        //
        /// See key codes in namespace gnash::key (gnash.h)

Index: testsuite/misc-ming.all/loadMovieTest.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/loadMovieTest.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- testsuite/misc-ming.all/loadMovieTest.c     18 Apr 2007 08:43:33 -0000      
1.3
+++ testsuite/misc-ming.all/loadMovieTest.c     18 Apr 2007 15:26:39 -0000      
1.4
@@ -242,8 +242,7 @@
        add_button(mo, 50, 220, "Clear", newSWFAction(
                                " art=_root.coverart;"
                                " for (i=0; i<art.lastdepth; ++i) {"
-                               "  art['child'+i].clear();"
-                               //"  art.removeMovieClip('child'+i);" // 
doesn't work !
+                               "  removeMovieClip('_root.coverart.child'+i);" 
                                " }"
                                " art.lastdepth=0;"
                                " art.clear(); "

Index: testsuite/misc-ming.all/loadMovieTestRunner.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/loadMovieTestRunner.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- testsuite/misc-ming.all/loadMovieTestRunner.cpp     18 Apr 2007 13:24:44 
-0000      1.7
+++ testsuite/misc-ming.all/loadMovieTestRunner.cpp     18 Apr 2007 15:26:39 
-0000      1.8
@@ -35,6 +35,41 @@
 using namespace gnash;
 using namespace std;
 
+std::auto_ptr<MovieTester> tester;
+boost::intrusive_ptr<sprite_instance> root;
+
+sprite_instance*
+getCoverArt()
+{
+       character* coverartch = 
const_cast<character*>(tester->findDisplayItemByName(*root, "coverart"));
+       sprite_instance* coverart = coverartch->to_movie();
+
+       //log_msg("Coverart is %p, displaylist is:", coverart);
+       //coverart->getDisplayList().dump();
+
+       return coverart;
+}
+
+void
+checkScribbling()
+{
+       sprite_instance* coverart = getCoverArt();
+
+       size_t initial_child_count = coverart->getDisplayList().size();
+
+       tester->movePointerTo(73, 204); // the "Scribble" button
+       check(tester->isMouseOverMouseEntity());
+       for (int i=1; i<=5; ++i) {
+               tester->click();
+               check_equals(coverart->getDisplayList().size(), 
initial_child_count+i);
+       }
+
+       tester->movePointerTo(59, 225); // the "clear" button
+       check(tester->isMouseOverMouseEntity());
+       tester->click();
+       check_equals(coverart->getDisplayList().size(), initial_child_count);
+}
+
 int
 main(int /*argc*/, char** /*argv*/)
 {
@@ -42,7 +77,7 @@
        dbglogfile.setVerbosity(1);
 
        string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
-       MovieTester tester(filename);
+       tester.reset(new MovieTester(filename));
 
        URL baseURL(filename);
        URL mediaURL(MEDIADIR"/");
@@ -52,64 +87,63 @@
        std::string url;
 
 
-       sprite_instance* root = tester.getRootMovie();
-       assert(root);
+       root = tester->getRootMovie();
+       assert(root.get());
 
        check_equals(root->get_frame_count(), 1);
        check_equals(root->get_current_frame(), 0);
 
-       tester.advance();
+       tester->advance();
        check_equals(root->get_current_frame(), 0);
 
        // Verify that 'coverart' exists and is empty
-       character* coverartch = 
const_cast<character*>(tester.findDisplayItemByName(*root, "coverart"));
+       character* coverartch = 
const_cast<character*>(tester->findDisplayItemByName(*root, "coverart"));
        sprite_instance* coverart = coverartch->to_movie();
        check(coverart);
        url = coverart->get_movie_definition()->get_url();
        check_equals(coverart->get_movie_definition()->get_url(), 
baseURL.str());
 
+       // Check scribbling on the empty canvas
+       checkScribbling();
+
        // Click on the first (lynch)
-       tester.movePointerTo(80, 80);
-       check(tester.isMouseOverMouseEntity());
-       tester.pressMouseButton();
+       tester->movePointerTo(80, 80);
+       check(tester->isMouseOverMouseEntity());
+       tester->pressMouseButton();
        sleep(1); // give it some time...
-       coverartch = const_cast<character*>(tester.findDisplayItemByName(*root, 
"coverart"));
+       coverartch = 
const_cast<character*>(tester->findDisplayItemByName(*root, "coverart"));
        check(coverart != coverartch->to_movie());
        coverart = coverartch->to_movie();
        check_equals(coverart->get_movie_definition()->get_url(), 
lynchURL.str());
-       tester.depressMouseButton();
+       tester->depressMouseButton();
+
+       // Check scribbling on the lynch
+       checkScribbling();
 
        // Click on the second (green)
-       tester.movePointerTo(280, 80);
-       check(tester.isMouseOverMouseEntity());
-       tester.pressMouseButton();
-       tester.depressMouseButton();
+       tester->movePointerTo(280, 80);
+       check(tester->isMouseOverMouseEntity());
+       tester->click();
        sleep(1); // give it some time...
-       coverartch = const_cast<character*>(tester.findDisplayItemByName(*root, 
"coverart"));
+       coverartch = 
const_cast<character*>(tester->findDisplayItemByName(*root, "coverart"));
        coverart = coverartch->to_movie();
        check_equals(coverart->get_movie_definition()->get_url(), 
greenURL.str());
        // TODO: find a way to test if the jpeg is really displayed
        //       (like turn it into a mouse-event-handling char and use 
isMouseOverActiveEntity ?)
 
+       // Check scribbling on the jpeg
+       checkScribbling();
+
        // Click on the third (offspring)
-       tester.movePointerTo(480, 80);
-       check(tester.isMouseOverMouseEntity());
-       tester.pressMouseButton();
-       tester.depressMouseButton();
+       tester->movePointerTo(480, 80);
+       check(tester->isMouseOverMouseEntity());
+       tester->click();
        sleep(1); // give it some time to load
-       coverartch = const_cast<character*>(tester.findDisplayItemByName(*root, 
"coverart"));
+       coverartch = 
const_cast<character*>(tester->findDisplayItemByName(*root, "coverart"));
        coverart = coverartch->to_movie();
        check_equals(coverart->get_movie_definition()->get_url(), 
offspringURL.str());
 
-       //---------------------------------------------------
-       // Now check that the active movieclip "buttons" work
-       //---------------------------------------------------
-
-       tester.movePointerTo(73, 204); // the "Scribble" button
-       check(tester.isMouseOverMouseEntity());
-
-       tester.movePointerTo(63, 227); // the "clear" button
-       check(tester.isMouseOverMouseEntity());
-
+       // Check scribbling on the offspring
+       checkScribbling();
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]