gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/ButtonE...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/ButtonE...
Date: Wed, 16 Apr 2008 08:35:39 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/04/16 08:35:39

Modified files:
        .              : ChangeLog 
        testsuite/misc-ming.all: ButtonEventsTest-Runner.cpp 
                                 ButtonEventsTest.c 

Log message:
        cleanup the test so to guide humans trough non-automated
        testing. Interestingly enough gnash seems to support onMouseUpOutside,
        but probably just sends an onMouseUp immediately afterwards, which would
        explain the failure in test runner.  Another pass at this test might
        make the failure even more visible (self-contained).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6290&r2=1.6291
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp?cvsroot=gnash&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/ButtonEventsTest.c?cvsroot=gnash&r1=1.11&r2=1.12

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6290
retrieving revision 1.6291
diff -u -b -r1.6290 -r1.6291
--- ChangeLog   16 Apr 2008 07:27:07 -0000      1.6290
+++ ChangeLog   16 Apr 2008 08:35:38 -0000      1.6291
@@ -1,3 +1,14 @@
+2008-04-16 Sandro Santilli <address@hidden>
+
+       * testsuite/misc-ming.all/: ButtonEventsTest-Runner.cpp,
+         ButtonEventsTest.c: cleanup the test so to guide
+         humans trough non-automated testing. Interestingly
+         enough gnash seems to support onMouseUpOutside, but
+         probably just sends an onMouseUp immediately afterwards,
+         which would explain the failure in test runner.
+         Another pass at this test might make the failure even
+         more visible (self-contained).
+
 2008-04-16 Benjamin Wolsey <address@hidden>
        
        * server/asobj/Global.cpp: register parseInt, parseFloat,

Index: testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp 15 Apr 2008 09:51:03 
-0000      1.24
+++ testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp 16 Apr 2008 08:35:39 
-0000      1.25
@@ -218,14 +218,10 @@
        sprite_instance* root = tester.getRootMovie();
        assert(root);
 
-       check_equals(root->get_frame_count(), 4);
+       check_equals(root->get_frame_count(), 5);
 
        check_equals(root->get_current_frame(), 0);
 
-       const character* mc1 = tester.findDisplayItemByName(*root, "square1");
-       check(mc1);
-       check_equals(mc1->get_depth(), 2+character::staticDepthOffset);
-
        const character* text = tester.findDisplayItemByName(*root, 
"textfield");
        check(text);
 
@@ -238,27 +234,34 @@
        check_equals(string(text->get_text_value()), idleString);
        check_equals(string(text2->get_text_value()), idleString);
        check_equals(string(text3->get_text_value()), idleString);
+
+       tester.advance();
+
+       const character* mc1 = tester.findDisplayItemByName(*root, "square1");
+       check(mc1);
+       check_equals(mc1->get_depth(), 2+character::staticDepthOffset);
+
        check(!tester.isMouseOverMouseEntity());
        // check that pixel @ 60,60 is red !
        rgba red(255,0,0,255);
        check_pixel(60, 60, 2, red, 2);
 
-       for (size_t fno=0; fno<root->get_frame_count(); fno++)
+       for (size_t fno=root->get_current_frame(); fno<root->get_frame_count(); 
fno++)
        {
                const character* square_back = 
tester.findDisplayItemByDepth(*root, 1+character::staticDepthOffset);
                const character* square_front = 
tester.findDisplayItemByDepth(*root, 3+character::staticDepthOffset);
 
                switch (fno)
                {
-                       case 0:
+                       case 1:
                                check(!square_back);
                                check(!square_front);
                                break;
-                       case 1:
+                       case 2:
                                check(square_back);
                                check(!square_front);
                                break;
-                       case 2:
+                       case 3:
                                check(square_back);
                                check(square_front);
                                break;
@@ -276,8 +279,9 @@
 
        }
 
-       // last advance should restart the loop...
-       check_equals(root->get_current_frame(), 0);
+       // last advance should not restart the loop (it's in STOP mode)
+        check_equals(root->get_play_state(), sprite_instance::STOP);
+       check_equals(root->get_current_frame(), 4);
 
 }
 

Index: testsuite/misc-ming.all/ButtonEventsTest.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/ButtonEventsTest.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- testsuite/misc-ming.all/ButtonEventsTest.c  15 Apr 2008 09:51:03 -0000      
1.11
+++ testsuite/misc-ming.all/ButtonEventsTest.c  16 Apr 2008 08:35:39 -0000      
1.12
@@ -143,57 +143,81 @@
 
        SWFButton_addAction(bu, compileSWFActionCode(
                "_root.msg='MouseOut';"
-               "_root.note('SWFBUTTON_MOUSEOUT');"
-               "_root.check_equals(_root.printBounds(getBounds()), 
'-0.05,-0.05 40.05,40.05');"
-               // Target of button action is the button's parent sprite
-               "_root.check_equals(_target, '/square1');"
-               "setTarget('/');"
-               "_root.check_equals(_target, '/');"
+               "if ( _root.testno == 4 || _root.testno == 9 || _root.testno == 
14 ) {"
+               "       _root.check_equals(_root.printBounds(getBounds()), 
'-0.05,-0.05 40.05,40.05');"
+               /* Target of button action is the button's parent sprite */
+               "       _root.check_equals(_target, '/square1');"
+               "       setTarget('/');"
+               "       _root.check_equals(_target, '/');"
+               "       _root.testno++;"
+               "       _root.note(_root.testno+'. Press mouse button inside 
the square, and release it outside.');"
+               "} else {"
+               //"     _root.note('SWFBUTTON_MOUSEOUT');"
+               "}"
                ), SWFBUTTON_MOUSEOUT);
 
        SWFButton_addAction(bu, compileSWFActionCode(
                "_root.msg='MouseOver';"
-               "_root.note('SWFBUTTON_MOUSEOVER');"
-               "_root.check_equals(_root.printBounds(getBounds()), 
'-0.05,-0.05 40.05,40.05');"
-               // Target of button action is the button's parent sprite
-               "_root.check_equals(_target, '/square1');"
-               "setTarget('/');"
-               "_root.check_equals(_target, '/');"
+               "if ( _root.testno == 1 || _root.testno == 6 || _root.testno == 
11 ) {"
+               "       _root.check_equals(_root.printBounds(getBounds()), 
'-0.05,-0.05 40.05,40.05');"
+               /* Target of button action is the button's parent sprite */
+               "       _root.check_equals(_target, '/square1');"
+               "       setTarget('/');"
+               "       _root.check_equals(_target, '/');"
+               "       _root.testno++;"
+               "       _root.note(_root.testno+'. Press (and keep pressed) the 
mouse button inside the square.');"
+               "} else {"
+               //"     _root.note('SWFBUTTON_MOUSEOVER');"
+               "}"
                ), SWFBUTTON_MOUSEOVER);
 
        SWFButton_addAction(bu, compileSWFActionCode(
                "_root.msg='MouseDown';"
-               "_root.note('SWFBUTTON_MOUSEDOWN');"
-               "_root.check_equals(_root.printBounds(getBounds()), 
'-0.05,-0.05 40.05,40.05');"
+               "if ( _root.testno == 2 || _root.testno == 7 || _root.testno == 
12 ) {"
+               "       _root.check_equals(_root.printBounds(getBounds()), 
'-0.05,-0.05 40.05,40.05');"
                /* Target (and name) of button action is the button's parent 
sprite */
-               "_root.check_equals(_target, '/square1');"
-               "_root.check_equals(_name, 'square1');"
-               "setTarget('/');"
-               "_root.check_equals(_target, '/');"
-               "_root.check_equals(typeof(_name), 'string');"
-               "_root.check_equals(_name, '');"
+               "       _root.check_equals(_target, '/square1');"
+               "       _root.check_equals(_name, 'square1');"
+               "       setTarget('/');"
+               "       _root.check_equals(_target, '/');"
+               "       _root.check_equals(typeof(_name), 'string');"
+               "       _root.check_equals(_name, '');"
+               "       _root.testno++;"
+               "       _root.note(_root.testno+'. Depress the mouse button 
inside the square.');"
+               "} else {"
+               //"     _root.note('SWFBUTTON_MOUSEDOWN');"
+               "}"
                ), SWFBUTTON_MOUSEDOWN);
 
        SWFButton_addAction(bu, compileSWFActionCode(
                "_root.msg='MouseUp';"
-               "_root.note('SWFBUTTON_MOUSEUP');"
-               "_root.check_equals(_root.printBounds(getBounds()), 
'-0.05,-0.05 40.05,40.05');"
+               "if ( _root.testno == 3 || _root.testno == 8 || _root.testno == 
13 ) {"
+               "       _root.check_equals(_root.printBounds(getBounds()), 
'-0.05,-0.05 40.05,40.05');"
                /* Target of button action is the button's parent sprite */
-               "_root.check_equals(_target, '/square1');"
-               "setTarget('/');"
-               "_root.check_equals(_target, '/');"
+               "       _root.check_equals(_target, '/square1');"
+               "       setTarget('/');"
+               "       _root.check_equals(_target, '/');"
+               "       _root.testno++;"
+               "       _root.note(_root.testno+'. Move the mouse pointer off 
the square.');"
+               "} else {"
+               //"     _root.note('SWFBUTTON_MOUSEUP');"
+               "}"
                ), SWFBUTTON_MOUSEUP);
 
        /* SWFBUTTON_MOUSEUPOUTSIDE *should* be invoked !! */
        SWFButton_addAction(bu, compileSWFActionCode(
                "_root.msg='MouseUpOutside';"
-               "_root.note('SWFBUTTON_MOUSEUPOUTSIDE');"
-               "_root.check_equals(_root.printBounds(getBounds()), 
'-0.05,-0.05 40.05,40.05');"
+               "if ( _root.testno == 5 || _root.testno == 10 || _root.testno 
== 15 ) {"
+               "       _root.check_equals(_root.printBounds(getBounds()), 
'-0.05,-0.05 40.05,40.05');"
                /* Target of button action is the button's parent sprite */
-               "_root.check_equals(_target, '/square1');"
-               "_root.check_equals(_name, 'square1');"
-               "setTarget('/');"
-               "_root.check_equals(_target, '/');"
+               "       _root.check_equals(_target, '/square1');"
+               "       _root.check_equals(_name, 'square1');"
+               "       setTarget('/');"
+               "       _root.check_equals(_target, '/');"
+               "       _root.nextFrame();"
+               "} else {"
+               //"     _root.note('SWFBUTTON_MOUSEUPOUTSIDE');"
+               "}"
                ), SWFBUTTON_MOUSEUPOUTSIDE);
 
        it = SWFMovieClip_add(mc, (SWFBlock)bu);
@@ -283,6 +307,8 @@
        add_text_field(mo, "textfield2", "_root.msg2", "Mouse events", 11, 0, 
100);
        add_text_field(mo, "textfield3", "_root.msg3", "Key events", 12, 0, 80);
 
+       SWFMovie_nextFrame(mo); /* showFrame */
+
        /*****************************************************
         *
         * Add button
@@ -380,6 +406,13 @@
                "};"
                );
 
+       add_actions(mo,
+               "stop();"
+               "_root.testno=1;"
+               "_root.note('"
+               "1. Roll over the red square."
+               "');");
+
 
        SWFMovie_nextFrame(mo); /* showFrame */
 
@@ -398,6 +431,13 @@
 
                check_equals(mo, "printBounds(square1.getBounds())", 
"'-0.05,-0.05 40.05,40.05'");
 
+               add_actions(mo,
+                       "stop();"
+                       "_root.note('-- Added shape at lower depth --');"
+                       "_root.testno++;"
+                       "_root.note(_root.testno+'. Roll over the square.');"
+               );
+
                SWFMovie_nextFrame(mo); /* showFrame */
        }
 
@@ -413,6 +453,13 @@
                SWFDisplayItem_setDepth(itsh, 3);
                SWFDisplayItem_setColorAdd(itsh, 0, 0, 0, -128);
 
+               add_actions(mo,
+                       "stop();"
+                       "_root.note('-- Added shape at higher depth --');"
+                       "_root.testno++;"
+                       "_root.note(_root.testno+'. Roll over the square.');"
+               );
+
                SWFMovie_nextFrame(mo); /* showFrame */
        }
 
@@ -424,7 +471,11 @@
 
        {
 
-               add_actions(mo, "square1.button.enabled = false;");
+               add_actions(mo,
+                       "square1.button.enabled = false;"
+                       "stop();"
+                       "_root.note('-- Button disabled, try playing with it, 
nothing should happen --');"
+               );
                SWFMovie_nextFrame(mo); /* showFrame */
        }
 




reply via email to

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