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


From: Zou Lunkai
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/action_...
Date: Mon, 05 Mar 2007 08:29:05 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  07/03/05 08:29:05

Modified files:
        .              : ChangeLog 
        testsuite/misc-ming.all: action_execution_order_test.c 
Added files:
        testsuite/misc-ming.all: action_execution_order_extend_test.c 

Log message:
        a new testcase

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2533&r2=1.2534
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/action_execution_order_test.c?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/action_execution_order_extend_test.c?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2533
retrieving revision 1.2534
diff -u -b -r1.2533 -r1.2534
--- ChangeLog   4 Mar 2007 21:35:30 -0000       1.2533
+++ ChangeLog   5 Mar 2007 08:29:04 -0000       1.2534
@@ -1,3 +1,9 @@
+2007-03-05 Zou Lunkai <address@hidden>
+
+       * testsuite/action_execution_order_test.c: comments fix;
+         testsuite/action_execution_order_extend_test.c: a new testcase for 
testing 
+         action execution order.
+         
 2007-03-04 Tomas Groth Christensen <address@hidden>
 
        * libbase/curl_adapter.cpp: Added support for getting the total size

Index: testsuite/misc-ming.all/action_execution_order_test.c
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/misc-ming.all/action_execution_order_test.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- testsuite/misc-ming.all/action_execution_order_test.c       16 Feb 2007 
21:28:01 -0000      1.8
+++ testsuite/misc-ming.all/action_execution_order_test.c       5 Mar 2007 
08:29:05 -0000       1.9
@@ -65,7 +65,7 @@
   dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 
800, 600);
   SWFMovie_add(mo, (SWFBlock)dejagnuclip);
   add_actions(mo, " trace('as in frame0 of root');"); // can't use 'note' 
here, as it's not been defined yet
-  SWFMovie_nextFrame(mo);
+  SWFMovie_nextFrame(mo);  /* 1st frame */
 
   mc_blu = newSWFMovieClip();
   sh_blu = make_fill_square (20, 320, 20, 20, 0, 0, 255, 0, 0, 255);
@@ -83,7 +83,7 @@
   mc_red = newSWFMovieClip();
   sh_red = make_fill_square (0, 300, 60, 60, 255, 0, 0, 255, 0, 0);
   SWFMovieClip_add(mc_red, (SWFBlock)sh_red);  
-  /* Add mc_blu to mc_red and name it as "mc_red" */
+  /* Add mc_blu to mc_red and name it as "mc_blu" */
   it_blu = SWFMovieClip_add(mc_red, (SWFBlock)mc_blu);  
   SWFDisplayItem_setDepth(it_blu, 3); 
   SWFDisplayItem_setName(it_blu, "mc_blu");
@@ -107,10 +107,10 @@
   check_equals(mo, "typeOf(_root.mc_red)", "'movieclip'");
   check_equals(mo, "typeOf(_root.mc_red.func)", "'undefined'");
   check_equals(mo, "typeOf(_root.mc_red.mc_blu)", "'movieclip'");
-  SWFMovie_nextFrame(mo); /* 1st frame */
+  SWFMovie_nextFrame(mo); /* 2nd frame */
   add_actions(mo, " note('as in frame2 of root'); _root.x2 = \"as_in_root\"; 
");
   check_equals(mo, "typeOf(_root.mc_red.func)", "'function'");
-  SWFMovie_nextFrame(mo); /* 2nd frame */
+  SWFMovie_nextFrame(mo); /* 3rd frame */
 
   /* In the frame placing mc_red,  actions in mc_red is executed *after* 
actions in _root */
   check_equals(mo, "_root.x1", "'as_in_mc_blu'");
@@ -119,7 +119,7 @@
   check_equals(mo, "_root.x3", "'as_in_mc_blu_unload'");
   check_equals(mo, "_root.mc_unload_executed", "1");
   add_actions(mo, " _root.totals(); stop(); ");
-  SWFMovie_nextFrame(mo); /* 3rd frame */
+  SWFMovie_nextFrame(mo); /* 4th frame */
 
   /* Output movie */
   puts("Saving " OUTPUT_FILENAME );

Index: testsuite/misc-ming.all/action_execution_order_extend_test.c
===================================================================
RCS file: testsuite/misc-ming.all/action_execution_order_extend_test.c
diff -N testsuite/misc-ming.all/action_execution_order_extend_test.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/action_execution_order_extend_test.c        5 Mar 
2007 08:29:05 -0000       1.1
@@ -0,0 +1,179 @@
+/*
+ *   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */ 
+
+/*
+ * Zou Lunkai, address@hidden
+ *
+ * movieClip hiberarchy:
+ * main timeline  (5 frames)
+ *     |----dejagnuclip(placed at 1st frame of main timeline)
+ *     |----mc_red     (placed at 2nd frame of main timeline, and removed at 
4th frame)
+ *             |----mc_blu(placed at 1st frame of mc_red)
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "action_execution_order_extend_test.swf"
+
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip  mc_red, mc_blu, dejagnuclip;
+  SWFShape  sh_red, sh_blu;
+  SWFDisplayItem it_red, it_blu;
+
+  const char *srcdir=".";
+  if ( argc>1 ) 
+    srcdir=argv[1];
+  else
+  {
+      fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]);
+      return 1;
+  }
+
+  Ming_init();
+  mo = newSWFMovieWithVersion(OUTPUT_VERSION);
+  SWFMovie_setDimension(mo, 800, 600);
+  SWFMovie_setRate (mo, 1.0);
+
+  dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 
800, 600);
+  SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+  add_actions(mo, " trace('as in frame0 of root');"); // can't use 'note' 
here, as it's not been defined yet
+  SWFMovie_nextFrame(mo); /* 1st frame */
+
+  mc_blu = newSWFMovieClip();
+  sh_blu = make_fill_square (20, 320, 20, 20, 0, 0, 255, 0, 0, 255);
+  SWFMovieClip_add(mc_blu, (SWFBlock)sh_blu);  
+  add_clip_actions(mc_blu, " _root.note('as in frame1 of mc_blu'); _root.x1 = 
\"as_in_mc_blu\"; ");
+  SWFMovieClip_nextFrame(mc_blu); /* 1st frame */
+  add_clip_actions(mc_blu, " _root.note('as in frame2 of mc_blu'); _root.x2 = 
\"as_in_mc_blu\"; stop();");
+  SWFMovieClip_nextFrame(mc_blu); /* 2nd frame */
+  
+  mc_red = newSWFMovieClip();
+  sh_red = make_fill_square (0, 300, 60, 60, 255, 0, 0, 255, 0, 0);
+  SWFMovieClip_add(mc_red, (SWFBlock)sh_red);  
+  /* Add mc_blu to mc_red and name it as "mc_blu" */
+  it_blu = SWFMovieClip_add(mc_red, (SWFBlock)mc_blu);  
+  SWFDisplayItem_setDepth(it_blu, 10); 
+  SWFDisplayItem_setName(it_blu, "mc_blu");
+  add_clip_actions(mc_red, "_root.note('as in frame1 of mc_red'); _root.x1 = 
\"as_in_mc_red\"; ");
+  add_clip_actions(mc_red, " func = function() {}; ");
+  SWFMovieClip_nextFrame(mc_red); /* 1st frame */
+  add_clip_actions(mc_red, " _root.note('as in frame2 of mc_red'); _root.x2 = 
\"as_in_mc_red\"; stop();");
+  SWFMovieClip_nextFrame(mc_red); /* 2nd frame */
+  
+  /* Add mc_red to _root and name it as "mc_red" */
+  it_red = SWFMovie_add(mo, (SWFBlock)mc_red);  
+  SWFDisplayItem_setDepth(it_red, 20); 
+  SWFDisplayItem_setName(it_red, "mc_red");
+  
+  add_actions(mo, " note('as in frame2 of root'); var x1 = \"as_in_root\"; ");
+  add_actions(mo, " _root.mc_red.onLoad = function () \
+                   { \
+                       note('mc_red load executed'); \
+                       _root.y1 = 'mc_red onLoad called'; \
+                   }; \
+                   _root.mc_red.onEnterFrame = function () \
+                   { \
+                       note('mc_red enterFrame executed'); \
+                       _root.y2 = 'mc_red onEnterFrame called'; \
+                   }; \
+                   _root.mc_red.onUnload = function () \
+                   { \
+                       note('mc_red unload executed'); \
+                        _root.y3 = 'mc_red onUnload called'; \
+                   }; \
+                   _root.mc_red.mc_blu.onLoad = function () \
+                   { \
+                       note('mc_blu load executed'); \
+                       _root.y4 = 'mc_blu onLoad called'; \
+                   }; \
+                   _root.mc_red.mc_blu.onEnterFrame = function () \
+                   { \
+                       note('mc_blu enterFrame executed'); \
+                        _root.y5 = 'mc_blu onEnterFrame called'; \
+                   }; \
+                   _root.mc_red.mc_blu.onUnload = function () \
+                   { \
+                       note('mc_blu unload executed'); \
+                       _root.y6 = 'mc_blu onUnload called'; \
+                   };");
+
+  /*
+   * Check that the DisplayList is initialized deep to the mc_blu level
+   * Even if their actions are not expected to be executed yet
+   */
+  check_equals(mo, "typeOf(_root.mc_red)", "'movieclip'");
+  check_equals(mo, "typeOf(_root.mc_red.func)", "'undefined'");
+  check_equals(mo, "typeOf(_root.mc_red.mc_blu)", "'movieclip'");
+  SWFMovie_nextFrame(mo); /* 2nd frame */
+  
+  
+  add_actions(mo, " note('as in frame3 of root'); \
+                    _root.x2 = 'as_in_root'; \
+                    _root.y2 = 'as_in_root'; \
+                    _root.y5 = 'as_in_root';");
+  check_equals(mo, "typeOf(_root.mc_red.func)", "'function'");
+  SWFMovie_nextFrame(mo); /* 3rd frame */
+  
+  
+  SWFDisplayItem_remove(it_red);
+  add_actions(mo, " note('as in frame4 of root'); \
+                    _root.y3 = 'as_in_root'; \
+                    _root.y6 = 'as_in_root'; ");
+  /* In the frame placing mc_red,  actions in mc_red is executed *after* 
actions in _root */
+  check_equals(mo, "_root.x1", "'as_in_mc_blu'");
+  /* In subsequent frames, actions in mc_red is executed *before* actions in 
_root */
+  check_equals(mo, "_root.x2", "'as_in_root'");
+  SWFMovie_nextFrame(mo); /* 4th frame */
+  
+  /* mc_red Onload is not called */
+  xcheck_equals(mo, "_root.y1", "undefined");
+  /* actions in main timeline is executed *after* mc_red.onEnterFrame */
+  check_equals(mo, "_root.y2", "'as_in_root'");
+  /* actions in main timeline is executed *before* mc_red.onUnload in
+     this testcase, but I don't believe it is alway true. The actually order
+     may dependent on order of tags. It seems that Ming always place 
REMOVE_OBJECT
+     tag after DO_ACTION Tag. What if the order is reversed(I can't perform 
this 
+     with Ming)?? */
+  check_equals(mo, "_root.y3", "'mc_red onUnload called'");
+  /* mc_blu Onload is not called */
+  xcheck_equals(mo, "_root.y4", "undefined");
+  /* actions in main timeline is executed *after* mc_blu.onEnterFrame */
+  check_equals(mo, "_root.y5", "'as_in_root'");
+  /* actions in main timeline is executed *before* mc_blu.onUnload */
+  xcheck_equals(mo, "_root.y6", "'mc_blu onUnload called'");
+  add_actions(mo, " _root.totals(); stop(); ");
+  SWFMovie_nextFrame(mo); /* 5th frame */
+  
+  /* Output movie */
+  puts("Saving " OUTPUT_FILENAME );
+  SWFMovie_save(mo, OUTPUT_FILENAME);
+
+  return 0;
+}
+
+
+




reply via email to

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