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


From: Zou Lunkai
Subject: [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Makefil...
Date: Mon, 17 Dec 2007 07:33:26 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Zou Lunkai <zoulunkai>  07/12/17 07:33:26

Modified files:
        .              : ChangeLog 
        testsuite/misc-ming.all: Makefile.am 
Added files:
        testsuite/misc-ming.all: new_child_in_unload_test.c 

Log message:
        * testsuite/misc-ming.all/new_child_in_unload_test.c, Makefile.am:
          new test for inspecting ::destroy(). We may want to destroy an 
character
          that is not unloaded.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5187&r2=1.5188
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.171&r2=1.172
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/new_child_in_unload_test.c?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5187
retrieving revision 1.5188
diff -u -b -r1.5187 -r1.5188
--- ChangeLog   16 Dec 2007 10:10:51 -0000      1.5187
+++ ChangeLog   17 Dec 2007 07:33:25 -0000      1.5188
@@ -1,3 +1,9 @@
+2007-12-17 Zou Lunkai <address@hidden>
+       
+       * testsuite/misc-ming.all/new_child_in_unload_test.c, Makefile.am:
+         new test for inspecting ::destroy(). We may want to destroy an 
character
+         that is not unloaded.
+         
 2007-12-16 Sandro Santilli <address@hidden>
 
        * server/vm/ASHandlers.cpp (ActionImplementsOp):

Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.171
retrieving revision 1.172
diff -u -b -r1.171 -r1.172
--- testsuite/misc-ming.all/Makefile.am 14 Dec 2007 05:57:47 -0000      1.171
+++ testsuite/misc-ming.all/Makefile.am 17 Dec 2007 07:33:26 -0000      1.172
@@ -160,6 +160,7 @@
        morph_test1runner \
        opcode_guard_test \
        runtime_vm_stack_test \
+       new_child_in_unload_test \
        $(NULL)
 
 if MING_VERSION_0_4
@@ -246,6 +247,7 @@
        DefineEditTextVariableNameTest2-Runner \
        opcode_guard_testrunner \
        runtime_vm_stack_testrunner \
+       new_child_in_unload_testrunner \
        $(NULL)
 
 if MAKESWF_SUPPORTS_PREBUILT_CLIPS
@@ -355,6 +357,18 @@
        sh $< $(top_builddir) runtime_vm_stack_test.swf > $@
        chmod 755 $@
        
+new_child_in_unload_test_SOURCES =     \
+       new_child_in_unload_test.c      \
+       $(NULL)
+new_child_in_unload_test_LDADD = libgnashmingutils.la
+
+new_child_in_unload_test.swf: new_child_in_unload_test
+       ./new_child_in_unload_test $(top_srcdir)/testsuite/media
+
+new_child_in_unload_testrunner: $(srcdir)/../generic-testrunner.sh 
new_child_in_unload_test.swf
+       sh $< $(top_builddir) new_child_in_unload_test.swf > $@
+       chmod 755 $@
+               
 PlaceObject2Test_SOURCES =     \
        PlaceObject2Test.c      \
        $(NULL)

Index: testsuite/misc-ming.all/new_child_in_unload_test.c
===================================================================
RCS file: testsuite/misc-ming.all/new_child_in_unload_test.c
diff -N testsuite/misc-ming.all/new_child_in_unload_test.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/new_child_in_unload_test.c  17 Dec 2007 07:33:26 
-0000      1.1
@@ -0,0 +1,139 @@
+/* 
+ *   Copyright (C) 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 3 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
+ *
+ */ 
+
+/*
+ *---case1---
+ *
+ * Description:
+ *   (1) step1: create a dynamic child in an onClipUnload handler of 
static_mc1;
+ *   (2) step2: define a onUnload handler for the child;
+ *   (3) step3: remove static_mc1;
+ *
+ * Observed:
+ *  after step3:
+ *  (1) onClipUnload for static_mc1 is triggered.
+ *  (2) user defined onUnload for the dynamic child is NOT triggered.
+ *  (3) the dynamic child is destroyed even without onUnload triggered.
+ *
+ *---case2---
+ *  (1) step1: create a dynamic child in an onClipLoad handler of static_mc2;
+ *  (2) step2: define a onUnload handler for the child;
+ *  (3) step3: remove static_mc2;
+ *
+ * Observed:
+ *  after step3:
+ *  (1)onClipUnload for static_mc2 is triggered.
+ *  (2)user defined onUnload for the dynamic child is triggered.
+ *
+ * TODO:
+ *   seems createEmptyMovieClip() does not work in an user defined onUnload 
handler,
+ *   not sure why, need more inspect later. 
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "new_child_in_unload_test.swf"
+
+
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip  mc1, mc2, dejagnuclip;
+  SWFShape  sh1, sh2;
+  SWFDisplayItem it1, it2;
+  
+  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, 12.0);
+  
+  dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 
800, 600);
+  SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+  add_actions(mo, "testvar1 = 0; testvar2 = 0;");
+  SWFMovie_nextFrame(mo); // frame1
+  
+
+  mc1 = newSWFMovieClip();
+  SWFMovieClip_nextFrame(mc1);
+  it1 = SWFMovie_add(mo, (SWFBlock)mc1);  
+  SWFDisplayItem_setName(it1, "static_mc1");
+  SWFDisplayItem_addAction(it1,
+    newSWFAction(
+        " this.createEmptyMovieClip('dyn1', 100); "
+        " _root.check_equals(dyn1.getDepth(), 100);"
+        " _root.dyn1Ref = dyn1;"
+        // shouldn't be executed.
+        " dyn1.onUnload = function () { _root.check(false); } ;"
+        "trace(this);"
+    ),
+    SWFACTION_UNLOAD);  
+  
+  mc2 = newSWFMovieClip();
+  SWFMovieClip_nextFrame(mc2);
+  it2 = SWFMovie_add(mo, (SWFBlock)mc2);  
+  SWFDisplayItem_setName(it2, "static_mc2");
+  SWFDisplayItem_addAction(it2,
+    newSWFAction(
+       " this.createEmptyMovieClip('dyn2', 200); "
+       " _root.check_equals(dyn2.getDepth(), 200);"
+       " dyn2.onUnload = function () {_root.dyn2testvar = 'executed'; } ;"
+    ),
+    SWFACTION_ONLOAD);  
+  SWFDisplayItem_addAction(it2,
+    newSWFAction(
+      " _root.check_equals(_level0.dyn1Ref.getDepth(), 100);"
+    ),
+    SWFACTION_UNLOAD); 
+  SWFMovie_nextFrame(mo); // frame2
+
+  SWFDisplayItem_remove(it1);
+  SWFDisplayItem_remove(it2);
+  SWFMovie_nextFrame(mo); // frame3
+  
+  check_equals(mo, "typeof(_root.dyn1Ref)", "'movieclip'");
+  check_equals(mo, "_root.dyn1Ref.valueof()", "null");
+  // check that dyn2.onUnload was triggered
+  check_equals(mo, "_root.dyn2testvar", "'executed'");
+  SWFMovie_nextFrame(mo); // frame4
+
+  add_actions(mo, " _root.totals(6); stop(); ");
+  SWFMovie_nextFrame(mo); // frame5 
+  
+  //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]