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/registe...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/registe...
Date: Thu, 14 Feb 2008 11:02:36 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/02/14 11:02:36

Modified files:
        .              : ChangeLog 
        testsuite/misc-ming.all: registerClassTest2.c 

Log message:
        test that user-defined onLoad handler is still invoked if no clip events
        are defined and the object is not dynamic (placed by onClipEvent).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5645&r2=1.5646
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/registerClassTest2.c?cvsroot=gnash&r1=1.10&r2=1.11

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5645
retrieving revision 1.5646
diff -u -b -r1.5645 -r1.5646
--- ChangeLog   14 Feb 2008 10:08:06 -0000      1.5645
+++ ChangeLog   14 Feb 2008 11:02:35 -0000      1.5646
@@ -1,5 +1,11 @@
 2008-02-14 Sandro Santilli <address@hidden>
 
+       * testsuite/misc-ming.all/registerClassTest2.c: test that user-defined
+         onLoad handler is still invoked if no clip events are defined and
+         the object is not dynamic (placed by onClipEvent).
+
+2008-02-14 Sandro Santilli <address@hidden>
+
        * server/sprite_instance.cpp (on_event): still look for a user-defined
          onLoad handler if the sprite is dynamic. Fixes latest testcase, but
          not FlowPlayer yet (which was the inspiration for the previous

Index: testsuite/misc-ming.all/registerClassTest2.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/registerClassTest2.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- testsuite/misc-ming.all/registerClassTest2.c        16 Nov 2007 08:56:17 
-0000      1.10
+++ testsuite/misc-ming.all/registerClassTest2.c        14 Feb 2008 11:02:36 
-0000      1.11
@@ -69,7 +69,7 @@
   SWFMovie mo;
   SWFMovieClip  mc1, mc2, mc3, dejagnuclip;
   SWFShape  sh1, sh2, sh3;
-  SWFDisplayItem it1, it2, it3;
+  SWFDisplayItem it1, it2, it3, it4;
   const char *srcdir=".";
 
   if ( argc>1 ) srcdir=argv[1];
@@ -91,6 +91,12 @@
   dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 
80, 800, 600);
   SWFMovie_add(mo, (SWFBlock)dejagnuclip);
   
+  add_actions(mo,
+               "_root.theClass1onLoadCalls = new Array();"
+               "_root.theClass2onLoadCalls = new Array();"
+               "_root.theClass3onLoadCalls = new Array();"
+       );
+  
   // define two movieClips
   
   mc1 = newSWFMovieClip();
@@ -110,9 +116,10 @@
   
 
   add_actions(mo,
-    "theClass1 = function() { this.x = 60;};"
+    "theClass1 = function() { this.x = 60; this._alpha=20; };"
     "theClass1.prototype = new MovieClip();"
-    "theClass2 = function() { this.x = 600; this._x = 200;}; "
+    "theClass1.prototype.onLoad = function() { trace('theClass1 proto 
onLoad'); _root.theClass1onLoadCalls.push(this); };"
+    "theClass2 = function() { this.x = 600; this._x = 200; this._alpha=20;}; "
     "Object.registerClass('libItem1', theClass1);"
     "Object.registerClass('libItem2', theClass2);"
     "_root.attachMovie('libItem1', 'clip1', 10);"
@@ -154,12 +161,14 @@
   // Export mc3
   addExport(mo, mc3, "libItem3");  
   
-  add_actions(mo, "totals(21); stop();");
+  check_equals(mo, "_root.theClass1onLoadCalls.length", "1");
+  check_equals(mo, "_root.theClass1onLoadCalls[0]", "_level0.clip1");
    
   // add init actions for mc3
   add_clip_init_actions(mc3, " _root.note('mc3.initactions'); "
                              " theClass3 = function () {}; "
                              " theClass3.prototype = new MovieClip(); "
+                             " theClass3.prototype.onLoad = function() { 
trace('theClass3 proto onLoad'); _root.theClass3onLoadCalls.push(this); };"
                              " Object.registerClass('libItem3', theClass3); "
                              " _root.attachMovie('libItem3', 'clip3', 30); "
                              // clip3.__proto__ is initialized before 
executing onClipConstruct
@@ -181,8 +190,20 @@
                 ),
     SWFACTION_CONSTRUCT);
     
+  /* Place it again, no clip events this time */
+  it4 = SWFMovie_add(mo, mc3);
+  SWFDisplayItem_setName(it4, "noclipevs");
+
   SWFMovie_nextFrame(mo); /* end of frame3 */
      
+  check_equals(mo, "_root.theClass3onLoadCalls.length", "3");
+  check_equals(mo, "_root.theClass3onLoadCalls[0]", "_level0.instance2");
+  check_equals(mo, "_root.theClass3onLoadCalls[1]", "_level0.clip3");
+  check_equals(mo, "_root.theClass3onLoadCalls[2]", "_level0.noclipevs"); /* 
it4 ... */
+  add_actions(mo, "totals(27); stop();");
+    
+  SWFMovie_nextFrame(mo); /* end of frame4 */
+     
  /*****************************************************
   *
   * Output movie




reply via email to

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