gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r10340: Tests for attachMovie initOb


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10340: Tests for attachMovie initObj.
Date: Mon, 24 Nov 2008 18:20:29 +0100
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10340
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2008-11-24 18:20:29 +0100
message:
  Tests for attachMovie initObj.
modified:
  libcore/asobj/XML_as.cpp
  testsuite/misc-ming.all/attachMovieLoopingTest.c
  testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp
    ------------------------------------------------------------
    revno: 10335.1.3
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2008-11-24 17:07:05 +0100
    message:
      Silence debugging.
    modified:
      libcore/asobj/XML_as.cpp
    ------------------------------------------------------------
    revno: 10335.1.4
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2008-11-24 17:56:33 +0100
    message:
      Test that initObj properties should be available to the constructor
      used in attachMovie for SWF7. Warning: _height and _width are treated
      differently in SWF6!
      
      Alter test runner because the squares are different shapes.
    modified:
      testsuite/misc-ming.all/attachMovieLoopingTest.c
      testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp
=== modified file 'libcore/asobj/XML_as.cpp'
--- a/libcore/asobj/XML_as.cpp  2008-11-24 08:33:00 +0000
+++ b/libcore/asobj/XML_as.cpp  2008-11-24 16:07:05 +0000
@@ -364,12 +364,10 @@
 
     // Knock off the "/>" of a self-closing tag.
     if (std::equal(endName - 1, endName + 1, "/>")) {
-        //log_debug("self-closing tag");
         --endName;
     }
 
     std::string tagName(it, endName);
-    //log_debug("tagName : %s", tagName);
 
     if (!closing) {
 
@@ -484,7 +482,7 @@
 XML_as::parseComment(XMLNode_as* /*node*/, const std::string& xml, 
         std::string::const_iterator& it)
 {
-    log_debug("discarding comment node");
+    //log_debug("discarding comment node");
 
     std::string content;
 

=== modified file 'testsuite/misc-ming.all/attachMovieLoopingTest.c'
--- a/testsuite/misc-ming.all/attachMovieLoopingTest.c  2007-07-01 09:53:45 
+0000
+++ b/testsuite/misc-ming.all/attachMovieLoopingTest.c  2008-11-24 16:56:33 
+0000
@@ -34,7 +34,7 @@
 
 #include "ming_utils.h"
 
-#define OUTPUT_VERSION 6
+#define OUTPUT_VERSION 7
 #define OUTPUT_FILENAME "attachMovieLoopingTest.swf"
 
 void addRedSquareExport(SWFMovie mo);
@@ -103,12 +103,34 @@
        /* (maybe it's related to loop-back handling ?) */
        SWFMovie_nextFrame(mo); 
 
+    // This should run for four frames. The counter should only be reset
+    // on the first frame, i.e. when start is undefined. This should
+    // work for all swf versions, unlike "if (undefined < 4);"
+
        add_actions(mo, "initObj = new Object();");
+       add_actions(mo, "if (!started) { counter = 0; started = true; }");
+       add_actions(mo, "redsquare = function() { "
+            "           trace('hello redsquare'); "
+            "           if (counter > 0) {"
+            "               xcheck_equals(this._x, counter * 70);"
+            "                  xcheck_equals(this._height, 10 * counter + 5); "
+            "                  xcheck_equals(this.aProperty, 6); "
+            "           } else {"
+            "               check_equals(this._x, 0);"
+            "               xcheck_equals(this._height, 60.1);"
+            "                  check_equals(this.aProperty, undefined); "
+            "           };"
+            "       };"
+            "redsquare.prototype = new MovieClip();"
+            "Object.registerClass('redsquare', redsquare);"
+            );
 
        add_actions(mo,
                "if ( counter < 4 ) {"
-               "       if ( counter != undefined ) { "
+               "       if ( counter > 0 ) { "
+               "               initObj.aProperty = 6;"
                "               initObj._x = 70*counter;"
+               "               initObj._height = 10*counter + 5; "
                "               attachMovie('redsquare', "
                "                       'square'+counter, 70+counter, initObj);"
                "       } else {"
@@ -124,7 +146,7 @@
                "       counter++;"
                "       note('Next counter is '+counter);"
                "} else {"
-               "       totals(); stop();"
+               "       totals(16); stop();"
                "}"
                );
 

=== modified file 'testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp'
--- a/testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp  2008-10-25 
10:38:32 +0000
+++ b/testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp  2008-11-24 
16:56:33 +0000
@@ -77,7 +77,7 @@
        check(! tester.findDisplayItemByDepth(*root, 72) );
        check(! tester.findDisplayItemByDepth(*root, 73) );
 
-       tester.movePointerTo(100, 30);
+       tester.movePointerTo(100, 5);
        check(tester.isMouseOverMouseEntity());
        tester.movePointerTo(170, 30);
        check(!tester.isMouseOverMouseEntity());
@@ -90,7 +90,7 @@
        check( tester.findDisplayItemByDepth(*root, 72) );
        check(! tester.findDisplayItemByDepth(*root, 73) );
 
-       tester.movePointerTo(170, 30);
+       tester.movePointerTo(170, 10);
        check(tester.isMouseOverMouseEntity());
        tester.movePointerTo(240, 30);
        check(!tester.isMouseOverMouseEntity());
@@ -103,7 +103,7 @@
        check( tester.findDisplayItemByDepth(*root, 72) );
        check( tester.findDisplayItemByDepth(*root, 73) );
 
-       tester.movePointerTo(240, 30);
+       tester.movePointerTo(240, 5);
        check(tester.isMouseOverMouseEntity());
 }
 


reply via email to

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