gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog testsuite/actionscript.all/deja...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog testsuite/actionscript.all/deja...
Date: Mon, 27 Nov 2006 13:36:46 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/11/27 13:36:46

Modified files:
        .              : ChangeLog 
        testsuite/actionscript.all: dejagnu_so_init.as 

Log message:
                * testsuite/actionscript.all/dejagnu_so_init.as:
                  implement dejagnu initialization checker function
                  with setInterval (in addition to onEnterFrame).
                  This makes SWF5 targets work fine.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1786&r2=1.1787
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/dejagnu_so_init.as?cvsroot=gnash&r1=1.9&r2=1.10

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1786
retrieving revision 1.1787
diff -u -b -r1.1786 -r1.1787
--- ChangeLog   27 Nov 2006 11:22:42 -0000      1.1786
+++ ChangeLog   27 Nov 2006 13:36:45 -0000      1.1787
@@ -1,5 +1,9 @@
 2006-11-27 Sandro Santilli <address@hidden>
 
+       * testsuite/actionscript.all/dejagnu_so_init.as:
+         implement dejagnu initialization checker function
+         with setInterval (in addition to onEnterFrame).
+         This makes SWF5 targets work fine.
        * server/parser/movie_def_impl.cpp (create_instance):
          don't force the instance name to be _root !
        * server/sprite_instance.{h,cpp}: added support

Index: testsuite/actionscript.all/dejagnu_so_init.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/dejagnu_so_init.as,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- testsuite/actionscript.all/dejagnu_so_init.as       21 Nov 2006 19:26:35 
-0000      1.9
+++ testsuite/actionscript.all/dejagnu_so_init.as       27 Nov 2006 13:36:45 
-0000      1.10
@@ -4,13 +4,12 @@
 //       will be published with a frame-count of 0, thus
 //       actions in it will *NOT* be executed)
 //      We handle this by falling back to 'trace' mode if
-//       dejagnu module is not initialized after  'timeout' frames
-//      in a frameloop (that will depend on frame rate of *importing*
-//      movie, we'll assume a standard 20fps...
-//      movie
-
-this.timeout = 100; // 5 seconds of timeout (assuming 20fps)
+//       dejagnu module is not initialized after  a timeout.
 
+_dejagnu_checker_interval = 200; // milliseconds
+// 5 seconds of timeout 
+_dejagnu_checker_timeout = 5000/_dejagnu_checker_interval;
+_dejagnu_checker_iterations = 0;
 
 // By default 'makeswf' makes the __shared_assets clip invisible,
 // make it visible to *see* visual traces
@@ -23,12 +22,13 @@
        trace("__shared_assets undefined: did you run 'makeswf' with 
-i<path_to_Dejagnu.swf>:dejagnu ?");
 }
 
-this.framec = 0;
-this.onEnterFrame = function() {
+// Dejagnu initialization checking function
+checkIt = function() {
        if ( _root.dejagnu_module_initialized )
        {
                // disable frameloop
                this.onEnterFrame = undefined;
+               clearInterval(_dejagnu_checker_interval);
 
                // setup some dejagnu wrappers
                info = function(msg) {
@@ -58,14 +58,15 @@
                // jump to next frame
                gotoAndPlay(1);
        }
-       else if ( ++this.framec > this.timeout )
+       else if ( ++_dejagnu_checker_iterations > _dejagnu_checker_timeout )
        {
                // disable frameloop
+               clearInterval(_dejagnu_checker_interval);
                this.onEnterFrame = undefined;
 
                // complain
                trace("No properly initialized dejagnu module found after "
-                       + this.timeout + " frame loops.\n"
+                       + _dejagnu_checker_timeout + " iterations.\n"
                        + " Possible reasons are:\n"
                        + " 1) this testcase was compiled using a bogus\n"
                        + "    makeswf version (up to Ming-0.4.0-beta1).\n"
@@ -134,9 +135,16 @@
        }
        else
        {
-               var retries = this.timeout - this.framec;
-               trace("Dejagnu not initialized yet at frame " + framec +" will 
try again for another frame");
+               var retries = _dejagnu_checker_timeout - 
_dejagnu_checker_iterations;
+               trace("Dejagnu not initialized yet after " + 
_dejagnu_checker_iterations +" iterations. Will try again again");
        }
 };
 
+// frame loop seems not-working with SWF target 5, while
+// setInterval is not working with Gnash, we use both
+// to make sure it works :)
+
+_dejagnu_checker_interval = setInterval(checkIt, _dejagnu_checker_interval); 
+this.onEnterFrame = checkIt;
+
 stop();




reply via email to

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