gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash/testsuite/misc-ming.all registerClassTest2.c


From: Zou Lunkai
Subject: [Gnash-commit] gnash/testsuite/misc-ming.all registerClassTest2.c
Date: Fri, 21 Sep 2007 08:52:22 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  07/09/21 08:52:22

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

Log message:
        add tests for initactions and registerClass.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/registerClassTest2.c?cvsroot=gnash&r1=1.3&r2=1.4

Patches:
Index: registerClassTest2.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/registerClassTest2.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- registerClassTest2.c        12 Sep 2007 06:44:52 -0000      1.3
+++ registerClassTest2.c        21 Sep 2007 08:52:21 -0000      1.4
@@ -46,9 +46,9 @@
 main(int argc, char** argv)
 {
   SWFMovie mo;
-  SWFMovieClip  mc1, mc2, dejagnuclip;
-  SWFShape  sh1, sh2;
-  SWFDisplayItem it1, it2;
+  SWFMovieClip  mc1, mc2, mc3, dejagnuclip;
+  SWFShape  sh1, sh2, sh3;
+  SWFDisplayItem it1, it2, it3;
   const char *srcdir=".";
 
   if ( argc>1 ) srcdir=argv[1];
@@ -120,9 +120,44 @@
   // clip2 does not inherit MovieClip
   check_equals(mo, "clip2.getDepth()", "undefined");
 
-  add_actions(mo, "totals(); stop();");
   SWFMovie_nextFrame(mo); /* end of frame2 */
 
+
+ 
+  // Define movieclip mc2
+  mc3 = newSWFMovieClip();
+  sh3 = make_fill_square (0, 300, 100, 100, 255, 255, 0, 255, 255, 0);
+  SWFMovieClip_add(mc3, (SWFBlock)sh3);
+  
+  addExport(mo, mc2, "libItem3");  
+  
+  it3 = SWFMovie_add(mo, mc3);
+  SWFDisplayItem_addAction(it3,
+    newSWFAction(" _root.note('mc3.onClipInitialize'); " 
+                 " _root.xcheck_equals(typeof(_root.clip3), 'movieclip');" 
+                 " _root.xcheck_equals(_root.clip3.__proto__, 
_root.theClass3.prototype);" 
+                 ),
+    SWFACTION_INIT);
+    
+  SWFDisplayItem_addAction(it3,
+    newSWFAction(" _root.note('mc3.onClipConstruct'); "
+                 " _root.xcheck_equals(typeof(_root.clip3), 'movieclip'); "
+                 // this one is passed by luck at the moment, both are 
undefined for Gnash
+                 " _root.check_equals(_root.clip3.__proto__, 
_root.theClass3.prototype);"
+                ),
+    SWFACTION_CONSTRUCT);
+
+  // add init actions for mc3
+  add_clip_init_actions(mc3, " _root.note('initactions for mc3'); "
+                             " theClass3 = function () {}; "
+                             " theClass3.prototype = new MovieClip(); "
+                             " Object.registerClass('libItem3', theClass3); "
+                             " _root.attachMovie('libItem3', 'clip3', 30); ");
+  SWFMovieClip_nextFrame(mc3);
+  
+  add_actions(mo, "totals(); stop();");
+  SWFMovie_nextFrame(mo); /* end of frame4 */
+     
  /*****************************************************
   *
   * Output movie




reply via email to

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